libc-0.2.152/.cargo_vcs_info.json 0000644 00000000136 00000000001 0012114 0 ustar {
"git": {
"sha1": "3d175191e6c6ad2b97de090d86d28dbfa4d271a3"
},
"path_in_vcs": ""
} libc-0.2.152/.gitignore 0000644 0000000 0000000 00000000033 10461020230 0012670 0 ustar 0000000 0000000 target
Cargo.lock
*~
style
libc-0.2.152/CONTRIBUTING.md 0000644 0000000 0000000 00000011270 10461020230 0013136 0 ustar 0000000 0000000 # Contributing to `libc`
Welcome! If you are reading this document, it means you are interested in contributing
to the `libc` crate.
## v0.2 changes
If you want to add your changes to v0.2, please submit them to the `libc-0.2` branch.
If you want to add any breaking changes, it should be submitted to the main branch,
which has changes for v0.3.
We will support and make a new release for v0.2 until we make the first release of v0.3.
## Adding an API
Want to use an API which currently isn't bound in `libc`? It's quite easy to add
one!
The internal structure of this crate is designed to minimize the number of
`#[cfg]` attributes in order to easily be able to add new items which apply
to all platforms in the future. As a result, the crate is organized
hierarchically based on platform. Each module has a number of `#[cfg]`'d
children, but only one is ever actually compiled. Each module then reexports all
the contents of its children.
This means that for each platform that libc supports, the path from a
leaf module to the root will contain all bindings for the platform in question.
Consequently, this indicates where an API should be added! Adding an API at a
particular level in the hierarchy means that it is supported on all the child
platforms of that level. For example, when adding a Unix API it should be added
to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to
`src/unix/linux_like/linux/mod.rs`.
If you're not 100% sure at what level of the hierarchy an API should be added
at, fear not! This crate has CI support which tests any binding against all
platforms supported, so you'll see failures if an API is added at the wrong
level or has different signatures across platforms.
New symbol(s) (i.e. functions, constants etc.) should also be added to the
symbols list(s) found in the `libc-test/semver` directory. These lists keep
track of what symbols are public in the libc crate and ensures they remain
available between changes to the crate. If the new symbol(s) are available on
all supported Unixes it should be added to `unix.txt` list1,
otherwise they should be added to the OS specific list(s).
With that in mind, the steps for adding a new API are:
1. Determine where in the module hierarchy your API should be added.
2. Add the API, including adding new symbol(s) to the semver lists.
3. Send a PR to this repo.
4. Wait for CI to pass, fixing errors.
5. Wait for a merge!
1: Note that this list has nothing to do with any Unix or Posix
standard, it's just a list shared between all OSs that declare `#[cfg(unix)]`.
## Test before you commit
We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
1. [`libc-test`](https://github.com/gnzlbg/ctest)
- `cd libc-test && cargo test`
- Use the `skip_*()` functions in `build.rs` if you really need a workaround.
2. Style checker
- [`sh ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh)
## Breaking change policy
Sometimes an upstream adds a breaking change to their API e.g. removing outdated items,
changing the type signature, etc. And we probably should follow that change to build the
`libc` crate successfully. It's annoying to do the equivalent of semver-major versioning
for each such change. Instead, we mark the item as deprecated and do the actual change
after a certain period. The steps are:
1. Add `#[deprecated(since = "", note="")]` attribute to the item.
- The `since` field should have a next version of `libc`
(e.g., if the current version is `0.2.1`, it should be `0.2.2`).
- The `note` field should have a reason to deprecate and a tracking issue to call for comments
(e.g., "We consider removing this as the upstream removed it.
If you're using it, please comment on #XXX").
2. If we don't see any concerns for a while, do the change actually.
## Supported target policy
When Rust removes a support for a target, the libc crate also may remove the support anytime.
## Releasing your change to crates.io
Now that you've done the amazing job of landing your new API or your new
platform in this crate, the next step is to get that sweet, sweet usage from
crates.io! The only next step is to bump the version of libc and then publish
it. If you'd like to get a release out ASAP you can follow these steps:
1. Increment the patch version number in `Cargo.toml` and `libc-test/Cargo.toml`.
1. Send a PR to this repository. It should [look like this][example-pr], but it'd
also be nice to fill out the description with a small rationale for the
release (any rationale is ok though!).
1. Once merged, the release will be tagged and published by one of the libc crate
maintainers.
[example-pr]: https://github.com/rust-lang/libc/pull/2120
libc-0.2.152/Cargo.toml 0000644 00000011320 00000000001 0010107 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
name = "libc"
version = "0.2.152"
authors = ["The Rust Project Developers"]
build = "build.rs"
exclude = [
"/ci/*",
"/.github/*",
"/.cirrus.yml",
"/triagebot.toml",
]
description = """
Raw FFI bindings to platform libraries like libc.
"""
homepage = "https://github.com/rust-lang/libc"
documentation = "https://docs.rs/libc/"
readme = "README.md"
keywords = [
"libc",
"ffi",
"bindings",
"operating",
"system",
]
categories = [
"external-ffi-bindings",
"no-std",
"os",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/libc"
[package.metadata.docs.rs]
cargo-args = ["-Zbuild-std=core"]
default-target = "x86_64-unknown-linux-gnu"
features = [
"const-extern-fn",
"extra_traits",
]
targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-linux-android",
"aarch64-pc-windows-msvc",
"aarch64-unknown-freebsd",
"aarch64-unknown-fuchsia",
"aarch64-unknown-hermit",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-unknown-netbsd",
"aarch64-unknown-openbsd",
"aarch64-wrs-vxworks",
"arm-linux-androideabi",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf",
"arm-unknown-linux-musleabi",
"arm-unknown-linux-musleabihf",
"armebv7r-none-eabi",
"armebv7r-none-eabihf",
"armv5te-unknown-linux-gnueabi",
"armv5te-unknown-linux-musleabi",
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-musleabihf",
"armv7-wrs-vxworks-eabihf",
"armv7r-none-eabi",
"armv7r-none-eabihf",
"hexagon-unknown-linux-musl",
"i586-pc-windows-msvc",
"i586-unknown-linux-gnu",
"i586-unknown-linux-musl",
"i686-linux-android",
"i686-pc-windows-gnu",
"i686-pc-windows-msvc",
"i686-pc-windows-msvc",
"i686-unknown-freebsd",
"i686-unknown-haiku",
"i686-unknown-linux-gnu",
"i686-unknown-linux-musl",
"i686-unknown-netbsd",
"i686-unknown-openbsd",
"i686-wrs-vxworks",
"mips-unknown-linux-gnu",
"mips-unknown-linux-musl",
"mips64-unknown-linux-gnuabi64",
"mips64-unknown-linux-muslabi64",
"mips64el-unknown-linux-gnuabi64",
"mips64el-unknown-linux-muslabi64",
"mipsel-sony-psp",
"mipsel-unknown-linux-gnu",
"mipsel-unknown-linux-musl",
"nvptx64-nvidia-cuda",
"powerpc-unknown-linux-gnu",
"powerpc-unknown-linux-gnuspe",
"powerpc-unknown-netbsd",
"powerpc-wrs-vxworks",
"powerpc-wrs-vxworks-spe",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
"powerpc64-wrs-vxworks",
"powerpc64le-unknown-linux-gnu",
"riscv32gc-unknown-linux-gnu",
"riscv32i-unknown-none-elf",
"riscv32imac-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"riscv64gc-unknown-freebsd",
"riscv64gc-unknown-hermit",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"riscv64gc-unknown-none-elf",
"riscv64imac-unknown-none-elf",
"s390x-unknown-linux-gnu",
"s390x-unknown-linux-musl",
"sparc-unknown-linux-gnu",
"sparc64-unknown-linux-gnu",
"sparc64-unknown-netbsd",
"sparcv9-sun-solaris",
"thumbv6m-none-eabi",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
"thumbv7m-none-eabi",
"thumbv7neon-linux-androideabi",
"thumbv7neon-unknown-linux-gnueabihf",
"wasm32-unknown-emscripten",
"wasm32-unknown-unknown",
"wasm32-wasi",
"x86_64-apple-darwin",
"x86_64-apple-ios",
"x86_64-fortanix-unknown-sgx",
"x86_64-linux-android",
"x86_64-pc-solaris",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc",
"x86_64-unknown-dragonfly",
"x86_64-unknown-freebsd",
"x86_64-unknown-fuchsia",
"x86_64-unknown-haiku",
"x86_64-unknown-hermit",
"x86_64-unknown-illumos",
"x86_64-unknown-l4re-uclibc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-gnux32",
"x86_64-unknown-linux-musl",
"x86_64-unknown-netbsd",
"x86_64-unknown-openbsd",
"x86_64-unknown-redox",
"x86_64-wrs-vxworks",
]
[dependencies.rustc-std-workspace-core]
version = "1.0.0"
optional = true
[features]
align = []
const-extern-fn = []
default = ["std"]
extra_traits = []
rustc-dep-of-std = [
"align",
"rustc-std-workspace-core",
]
std = []
use_std = ["std"]
libc-0.2.152/Cargo.toml.orig 0000644 0000000 0000000 00000010404 10461020230 0013572 0 ustar 0000000 0000000 [package]
name = "libc"
version = "0.2.152"
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/libc"
homepage = "https://github.com/rust-lang/libc"
documentation = "https://docs.rs/libc/"
keywords = ["libc", "ffi", "bindings", "operating", "system"]
categories = ["external-ffi-bindings", "no-std", "os"]
build = "build.rs"
exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml"]
description = """
Raw FFI bindings to platform libraries like libc.
"""
[package.metadata.docs.rs]
features = ["const-extern-fn", "extra_traits"]
default-target = "x86_64-unknown-linux-gnu"
targets = [
"aarch64-apple-darwin",
"aarch64-apple-ios",
"aarch64-linux-android",
"aarch64-pc-windows-msvc",
"aarch64-unknown-freebsd",
"aarch64-unknown-fuchsia",
"aarch64-unknown-hermit",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-unknown-netbsd",
"aarch64-unknown-openbsd",
"aarch64-wrs-vxworks",
"arm-linux-androideabi",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf",
"arm-unknown-linux-musleabi",
"arm-unknown-linux-musleabihf",
"armebv7r-none-eabi",
"armebv7r-none-eabihf",
"armv5te-unknown-linux-gnueabi",
"armv5te-unknown-linux-musleabi",
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabihf",
"armv7-unknown-linux-musleabihf",
"armv7-wrs-vxworks-eabihf",
"armv7r-none-eabi",
"armv7r-none-eabihf",
"hexagon-unknown-linux-musl",
"i586-pc-windows-msvc",
"i586-unknown-linux-gnu",
"i586-unknown-linux-musl",
"i686-linux-android",
"i686-pc-windows-gnu",
"i686-pc-windows-msvc",
"i686-pc-windows-msvc",
"i686-unknown-freebsd",
"i686-unknown-haiku",
"i686-unknown-linux-gnu",
"i686-unknown-linux-musl",
"i686-unknown-netbsd",
"i686-unknown-openbsd",
"i686-wrs-vxworks",
"mips-unknown-linux-gnu",
"mips-unknown-linux-musl",
"mips64-unknown-linux-gnuabi64",
"mips64-unknown-linux-muslabi64",
"mips64el-unknown-linux-gnuabi64",
"mips64el-unknown-linux-muslabi64",
"mipsel-sony-psp",
"mipsel-unknown-linux-gnu",
"mipsel-unknown-linux-musl",
"nvptx64-nvidia-cuda",
"powerpc-unknown-linux-gnu",
"powerpc-unknown-linux-gnuspe",
"powerpc-unknown-netbsd",
"powerpc-wrs-vxworks",
"powerpc-wrs-vxworks-spe",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
"powerpc64-wrs-vxworks",
"powerpc64le-unknown-linux-gnu",
"riscv32gc-unknown-linux-gnu",
"riscv32i-unknown-none-elf",
"riscv32imac-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"riscv64gc-unknown-freebsd",
"riscv64gc-unknown-hermit",
"riscv64gc-unknown-linux-gnu",
"riscv64gc-unknown-linux-musl",
"riscv64gc-unknown-none-elf",
"riscv64imac-unknown-none-elf",
"s390x-unknown-linux-gnu",
"s390x-unknown-linux-musl",
"sparc-unknown-linux-gnu",
"sparc64-unknown-linux-gnu",
"sparc64-unknown-netbsd",
"sparcv9-sun-solaris",
"thumbv6m-none-eabi",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
"thumbv7m-none-eabi",
"thumbv7neon-linux-androideabi",
"thumbv7neon-unknown-linux-gnueabihf",
"wasm32-unknown-emscripten",
"wasm32-unknown-unknown",
"wasm32-wasi",
"x86_64-apple-darwin",
"x86_64-apple-ios",
"x86_64-fortanix-unknown-sgx",
"x86_64-linux-android",
"x86_64-pc-solaris",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc",
"x86_64-unknown-dragonfly",
"x86_64-unknown-freebsd",
"x86_64-unknown-fuchsia",
"x86_64-unknown-haiku",
"x86_64-unknown-hermit",
"x86_64-unknown-illumos",
"x86_64-unknown-l4re-uclibc",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-gnux32",
"x86_64-unknown-linux-musl",
"x86_64-unknown-netbsd",
"x86_64-unknown-openbsd",
"x86_64-unknown-redox",
"x86_64-wrs-vxworks"
]
cargo-args = ["-Zbuild-std=core"]
[dependencies]
rustc-std-workspace-core = { version = "1.0.0", optional = true }
[features]
default = ["std"]
std = []
align = []
rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
extra_traits = []
const-extern-fn = []
# use_std is deprecated, use `std` instead
use_std = ['std']
[workspace]
members = ["libc-test"]
libc-0.2.152/LICENSE-APACHE 0000644 0000000 0000000 00000022773 10461020230 0012643 0 ustar 0000000 0000000 Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
libc-0.2.152/LICENSE-MIT 0000644 0000000 0000000 00000002064 10461020230 0012342 0 ustar 0000000 0000000 Copyright (c) 2014-2020 The Rust Project Developers
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
libc-0.2.152/README.md 0000644 0000000 0000000 00000010463 10461020230 0012167 0 ustar 0000000 0000000 # libc - Raw FFI bindings to platforms' system libraries
[![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License]
`libc` provides all of the definitions necessary to easily interoperate with C
code (or "C-like" code) on each of the platforms that Rust supports. This
includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as
function headers (e.g. `malloc`).
This crate exports all underlying platform types, functions, and constants under
the crate root, so all items are accessible as `libc::foo`. The types and values
of all the exported APIs match the platform that libc is compiled for.
More detailed information about the design of this library can be found in its
[associated RFC][rfc].
[rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md
## v0.3 Roadmap
The main branch is now for v0.3 which has some breaking changes.
For v0.2, please submit PRs to the `libc-0.2` branch instead.
We will stop making new v0.2 releases once we release v0.3 on crates.io.
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for details.
## Usage
Add the following to your `Cargo.toml`:
```toml
[dependencies]
libc = "0.2"
```
## Features
* `std`: by default `libc` links to the standard library. Disable this
feature to remove this dependency and be able to use `libc` in `#![no_std]`
crates.
* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`.
This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`.
* `const-extern-fn`: Changes some `extern fn`s into `const extern fn`s.
If you use Rust >= 1.62, this feature is implicitly enabled.
Otherwise it requires a nightly rustc.
* **deprecated**: `use_std` is deprecated, and is equivalent to `std`.
## Rust version support
The minimum supported Rust toolchain version is currently **Rust 1.13.0**.
(libc does not currently have any policy regarding changes to the minimum
supported Rust version; such policy is a work in progress.) APIs requiring
newer Rust features are only available on newer Rust toolchains:
| Feature | Version |
|----------------------|---------|
| `union` | 1.19.0 |
| `const mem::size_of` | 1.24.0 |
| `repr(align)` | 1.25.0 |
| `extra_traits` | 1.25.0 |
| `core::ffi::c_void` | 1.30.0 |
| `repr(packed(N))` | 1.33.0 |
| `cfg(target_vendor)` | 1.33.0 |
| `const-extern-fn` | 1.62.0 |
## Platform support
You can see the platform(target)-specific docs on [docs.rs], select a platform you want to see.
See
[`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh)
for the platforms on which `libc` is guaranteed to build for each Rust
toolchain. The test-matrix at [GitHub Actions] and [Cirrus CI] show the
platforms in which `libc` tests are run.
## License
This project is licensed under either of
* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-APACHE))
* [MIT License](https://opensource.org/licenses/MIT)
([LICENSE-MIT](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-MIT))
at your option.
## Contributing
We welcome all people who want to contribute. Please see the [contributing
instructions] for more information.
[contributing instructions]: https://github.com/rust-lang/libc/blob/HEAD/CONTRIBUTING.md
Contributions in any form (issues, pull requests, etc.) to this project
must adhere to Rust's [Code of Conduct].
[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
[GitHub Actions]: https://github.com/rust-lang/libc/actions
[GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg
[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc
[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg
[crates.io]: https://crates.io/crates/libc
[Latest Version]: https://img.shields.io/crates/v/libc.svg
[Documentation]: https://docs.rs/libc/badge.svg
[docs.rs]: https://docs.rs/libc
[License]: https://img.shields.io/crates/l/libc.svg
libc-0.2.152/build.rs 0000644 0000000 0000000 00000022521 10461020230 0012353 0 ustar 0000000 0000000 use std::env;
use std::process::Command;
use std::str;
use std::string::String;
// List of cfgs this build script is allowed to set. The list is needed to support check-cfg, as we
// need to know all the possible cfgs that this script will set. If you need to set another cfg
// make sure to add it to this list as well.
const ALLOWED_CFGS: &'static [&'static str] = &[
"emscripten_new_stat_abi",
"freebsd10",
"freebsd11",
"freebsd12",
"freebsd13",
"freebsd14",
"freebsd15",
"libc_align",
"libc_cfg_target_vendor",
"libc_const_extern_fn",
"libc_const_extern_fn_unstable",
"libc_const_size_of",
"libc_core_cvoid",
"libc_deny_warnings",
"libc_int128",
"libc_long_array",
"libc_non_exhaustive",
"libc_packedN",
"libc_priv_mod_use",
"libc_ptr_addr_of",
"libc_thread_local",
"libc_underscore_const_names",
"libc_union",
];
// Extra values to allow for check-cfg.
const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[
("target_os", &["switch", "aix", "ohos", "hurd"]),
("target_env", &["illumos", "wasi", "aix", "ohos"]),
(
"target_arch",
&["loongarch64", "mips32r6", "mips64r6", "csky"],
),
];
fn main() {
// Avoid unnecessary re-building.
println!("cargo:rerun-if-changed=build.rs");
let (rustc_minor_ver, is_nightly) = rustc_minor_nightly();
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
let libc_ci = env::var("LIBC_CI").is_ok();
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok();
if env::var("CARGO_FEATURE_USE_STD").is_ok() {
println!(
"cargo:warning=\"libc's use_std cargo feature is deprecated since libc 0.2.55; \
please consider using the `std` cargo feature instead\""
);
}
// The ABI of libc used by std is backward compatible with FreeBSD 12.
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
//
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
match which_freebsd() {
Some(10) if libc_ci => set_cfg("freebsd10"),
Some(11) if libc_ci => set_cfg("freebsd11"),
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
Some(13) if libc_ci => set_cfg("freebsd13"),
Some(14) if libc_ci => set_cfg("freebsd14"),
Some(15) if libc_ci => set_cfg("freebsd15"),
Some(_) | None => set_cfg("freebsd11"),
}
match emcc_version_code() {
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
// Non-Emscripten or version < 3.1.42.
Some(_) | None => (),
}
// On CI: deny all warnings
if libc_ci {
set_cfg("libc_deny_warnings");
}
// Rust >= 1.15 supports private module use:
if rustc_minor_ver >= 15 || rustc_dep_of_std {
set_cfg("libc_priv_mod_use");
}
// Rust >= 1.19 supports unions:
if rustc_minor_ver >= 19 || rustc_dep_of_std {
set_cfg("libc_union");
}
// Rust >= 1.24 supports const mem::size_of:
if rustc_minor_ver >= 24 || rustc_dep_of_std {
set_cfg("libc_const_size_of");
}
// Rust >= 1.25 supports repr(align):
if rustc_minor_ver >= 25 || rustc_dep_of_std || align_cargo_feature {
set_cfg("libc_align");
}
// Rust >= 1.26 supports i128 and u128:
if rustc_minor_ver >= 26 || rustc_dep_of_std {
set_cfg("libc_int128");
}
// Rust >= 1.30 supports `core::ffi::c_void`, so libc can just re-export it.
// Otherwise, it defines an incompatible type to retaining
// backwards-compatibility.
if rustc_minor_ver >= 30 || rustc_dep_of_std {
set_cfg("libc_core_cvoid");
}
// Rust >= 1.33 supports repr(packed(N)) and cfg(target_vendor).
if rustc_minor_ver >= 33 || rustc_dep_of_std {
set_cfg("libc_packedN");
set_cfg("libc_cfg_target_vendor");
}
// Rust >= 1.40 supports #[non_exhaustive].
if rustc_minor_ver >= 40 || rustc_dep_of_std {
set_cfg("libc_non_exhaustive");
}
// Rust >= 1.47 supports long array:
if rustc_minor_ver >= 47 || rustc_dep_of_std {
set_cfg("libc_long_array");
}
if rustc_minor_ver >= 51 || rustc_dep_of_std {
set_cfg("libc_ptr_addr_of");
}
// Rust >= 1.37.0 allows underscores as anonymous constant names.
if rustc_minor_ver >= 37 || rustc_dep_of_std {
set_cfg("libc_underscore_const_names");
}
// #[thread_local] is currently unstable
if rustc_dep_of_std {
set_cfg("libc_thread_local");
}
// Rust >= 1.62.0 allows to use `const_extern_fn` for "Rust" and "C".
if rustc_minor_ver >= 62 {
set_cfg("libc_const_extern_fn");
} else {
// Rust < 1.62.0 requires a crate feature and feature gate.
if const_extern_fn_cargo_feature {
if !is_nightly || rustc_minor_ver < 40 {
panic!("const-extern-fn requires a nightly compiler >= 1.40");
}
set_cfg("libc_const_extern_fn_unstable");
set_cfg("libc_const_extern_fn");
}
}
// check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the
// codebase. libc can configure it if the appropriate environment variable is passed. Since
// rust-lang/rust enforces it, this is useful when using a custom libc fork there.
//
// https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg
if libc_check_cfg {
for cfg in ALLOWED_CFGS {
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({})", cfg);
} else {
println!("cargo:rustc-check-cfg=values({})", cfg);
}
}
for &(name, values) in CHECK_CFG_EXTRA {
let values = values.join("\",\"");
if rustc_minor_ver >= 75 {
println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values);
} else {
println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values);
}
}
}
}
fn rustc_minor_nightly() -> (u32, bool) {
macro_rules! otry {
($e:expr) => {
match $e {
Some(e) => e,
None => panic!("Failed to get rustc version"),
}
};
}
let rustc = otry!(env::var_os("RUSTC"));
let output = Command::new(rustc)
.arg("--version")
.output()
.ok()
.expect("Failed to get rustc version");
if !output.status.success() {
panic!(
"failed to run rustc: {}",
String::from_utf8_lossy(output.stderr.as_slice())
);
}
let version = otry!(str::from_utf8(&output.stdout).ok());
let mut pieces = version.split('.');
if pieces.next() != Some("rustc 1") {
panic!("Failed to get rustc version");
}
let minor = pieces.next();
// If `rustc` was built from a tarball, its version string
// will have neither a git hash nor a commit date
// (e.g. "rustc 1.39.0"). Treat this case as non-nightly,
// since a nightly build should either come from CI
// or a git checkout
let nightly_raw = otry!(pieces.next()).split('-').nth(1);
let nightly = nightly_raw
.map(|raw| raw.starts_with("dev") || raw.starts_with("nightly"))
.unwrap_or(false);
let minor = otry!(otry!(minor).parse().ok());
(minor, nightly)
}
fn which_freebsd() -> Option {
let output = std::process::Command::new("freebsd-version").output().ok();
if output.is_none() {
return None;
}
let output = output.unwrap();
if !output.status.success() {
return None;
}
let stdout = String::from_utf8(output.stdout).ok();
if stdout.is_none() {
return None;
}
let stdout = stdout.unwrap();
match &stdout {
s if s.starts_with("10") => Some(10),
s if s.starts_with("11") => Some(11),
s if s.starts_with("12") => Some(12),
s if s.starts_with("13") => Some(13),
s if s.starts_with("14") => Some(14),
s if s.starts_with("15") => Some(15),
_ => None,
}
}
fn emcc_version_code() -> Option {
let output = std::process::Command::new("emcc")
.arg("-dumpversion")
.output()
.ok();
if output.is_none() {
return None;
}
let output = output.unwrap();
if !output.status.success() {
return None;
}
let stdout = String::from_utf8(output.stdout).ok();
if stdout.is_none() {
return None;
}
let version = stdout.unwrap();
// Some Emscripten versions come with `-git` attached, so split the
// version string also on the `-` char.
let mut pieces = version.trim().split(|c| c == '.' || c == '-');
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
Some(major * 10000 + minor * 100 + patch)
}
fn set_cfg(cfg: &str) {
if !ALLOWED_CFGS.contains(&cfg) {
panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg);
}
println!("cargo:rustc-cfg={}", cfg);
}
libc-0.2.152/rustfmt.toml 0000644 0000000 0000000 00000000036 10461020230 0013304 0 ustar 0000000 0000000 error_on_line_overflow = true
libc-0.2.152/src/fixed_width_ints.rs 0000644 0000000 0000000 00000011424 10461020230 0015376 0 ustar 0000000 0000000 //! This module contains type aliases for C's fixed-width integer types .
//!
//! These aliases are deprecated: use the Rust types instead.
#[deprecated(since = "0.2.55", note = "Use i8 instead.")]
pub type int8_t = i8;
#[deprecated(since = "0.2.55", note = "Use i16 instead.")]
pub type int16_t = i16;
#[deprecated(since = "0.2.55", note = "Use i32 instead.")]
pub type int32_t = i32;
#[deprecated(since = "0.2.55", note = "Use i64 instead.")]
pub type int64_t = i64;
#[deprecated(since = "0.2.55", note = "Use u8 instead.")]
pub type uint8_t = u8;
#[deprecated(since = "0.2.55", note = "Use u16 instead.")]
pub type uint16_t = u16;
#[deprecated(since = "0.2.55", note = "Use u32 instead.")]
pub type uint32_t = u32;
#[deprecated(since = "0.2.55", note = "Use u64 instead.")]
pub type uint64_t = u64;
cfg_if! {
if #[cfg(all(libc_int128, target_arch = "aarch64", not(target_os = "windows")))] {
// This introduces partial support for FFI with __int128 and
// equivalent types on platforms where Rust's definition is validated
// to match the standard C ABI of that platform.
//
// Rust does not guarantee u128/i128 are sound for FFI, and its
// definitions are in fact known to be incompatible. [0]
//
// However these problems aren't fundamental, and are just platform
// inconsistencies. Specifically at the time of this writing:
//
// * For x64 SysV ABIs (everything but Windows), the types are underaligned.
// * For all Windows ABIs, Microsoft doesn't actually officially define __int128,
// and as a result different implementations don't actually agree on its ABI.
//
// But on the other major aarch64 platforms (android, linux, ios, macos) we have
// validated that rustc has the right ABI for these types. This is important because
// aarch64 uses these types in some fundamental OS types like user_fpsimd_struct,
// which represents saved simd registers.
//
// Any API which uses these types will need to `#[ignore(improper_ctypes)]`
// until the upstream rust issue is resolved, but this at least lets us make
// progress on platforms where this type is important.
//
// The list of supported architectures and OSes is intentionally very restricted,
// as careful work needs to be done to verify that a particular platform
// has a conformant ABI.
//
// [0]: https://github.com/rust-lang/rust/issues/54341
/// C `__int128` (a GCC extension that's part of many ABIs)
pub type __int128 = i128;
/// C `unsigned __int128` (a GCC extension that's part of many ABIs)
pub type __uint128 = u128;
/// C __int128_t (alternate name for [__int128][])
pub type __int128_t = i128;
/// C __uint128_t (alternate name for [__uint128][])
pub type __uint128_t = u128;
cfg_if! {
if #[cfg(libc_underscore_const_names)] {
macro_rules! static_assert_eq {
($a:expr, $b:expr) => {
const _: [(); $a] = [(); $b];
};
}
// NOTE: if you add more platforms to here, you may need to cfg
// these consts. They should always match the platform's values
// for `sizeof(__int128)` and `_Alignof(__int128)`.
const _SIZE_128: usize = 16;
const _ALIGN_128: usize = 16;
// Since Rust doesn't officially guarantee that these types
// have compatible ABIs, we const assert that these values have the
// known size/align of the target platform's libc. If rustc ever
// tries to regress things, it will cause a compilation error.
//
// This isn't a bullet-proof solution because e.g. it doesn't
// catch the fact that llvm and gcc disagree on how x64 __int128
// is actually *passed* on the stack (clang underaligns it for
// the same reason that rustc *never* properly aligns it).
static_assert_eq!(core::mem::size_of::<__int128>(), _SIZE_128);
static_assert_eq!(core::mem::align_of::<__int128>(), _ALIGN_128);
static_assert_eq!(core::mem::size_of::<__uint128>(), _SIZE_128);
static_assert_eq!(core::mem::align_of::<__uint128>(), _ALIGN_128);
static_assert_eq!(core::mem::size_of::<__int128_t>(), _SIZE_128);
static_assert_eq!(core::mem::align_of::<__int128_t>(), _ALIGN_128);
static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128);
static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128);
}
}
}
}
libc-0.2.152/src/fuchsia/aarch64.rs 0000644 0000000 0000000 00000003640 10461020230 0014716 0 ustar 0000000 0000000 pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
pub type wchar_t = u32;
pub type nlink_t = ::c_ulong;
pub type blksize_t = ::c_long;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad0: ::c_ulong,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
__pad1: ::c_int,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_uint; 2],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
__pad0: ::c_ulong,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
__pad1: ::c_int,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_uint; 2],
}
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong,
}
}
// From https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/bits/signal.h;l=20-21;drc=0827b18ab9540c46f8037f407d17ea15a79e9ba7
pub const MINSIGSTKSZ: ::size_t = 6144;
pub const SIGSTKSZ: ::size_t = 12288;
libc-0.2.152/src/fuchsia/align.rs 0000644 0000000 0000000 00000012550 10461020230 0014560 0 ustar 0000000 0000000 macro_rules! expand_align {
() => {
s! {
#[cfg_attr(
any(
target_pointer_width = "32",
target_arch = "x86_64"
),
repr(align(4)))]
#[cfg_attr(
not(any(
target_pointer_width = "32",
target_arch = "x86_64"
)),
repr(align(8)))]
pub struct pthread_mutexattr_t {
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
#[cfg_attr(target_pointer_width = "32",
repr(align(4)))]
#[cfg_attr(target_pointer_width = "64",
repr(align(8)))]
pub struct pthread_rwlockattr_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
#[repr(align(4))]
pub struct pthread_condattr_t {
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
}
s_no_extra_traits! {
#[cfg_attr(all(target_pointer_width = "32",
any(target_arch = "arm",
target_arch = "x86_64")),
repr(align(4)))]
#[cfg_attr(any(target_pointer_width = "64",
not(any(target_arch = "arm",
target_arch = "x86_64"))),
repr(align(8)))]
pub struct pthread_mutex_t {
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
}
#[cfg_attr(all(target_pointer_width = "32",
any(target_arch = "arm",
target_arch = "x86_64")),
repr(align(4)))]
#[cfg_attr(any(target_pointer_width = "64",
not(any(target_arch = "arm",
target_arch = "x86_64"))),
repr(align(8)))]
pub struct pthread_rwlock_t {
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
#[cfg_attr(target_pointer_width = "32",
repr(align(4)))]
#[cfg_attr(target_pointer_width = "64",
repr(align(8)))]
#[cfg_attr(target_arch = "x86",
repr(align(4)))]
#[cfg_attr(not(target_arch = "x86"),
repr(align(8)))]
pub struct pthread_cond_t {
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash(&self, state: &mut H) {
self.size.hash(state);
}
}
impl PartialEq for pthread_mutex_t {
fn eq(&self, other: &pthread_mutex_t) -> bool {
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_mutex_t {}
impl ::fmt::Debug for pthread_mutex_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_mutex_t")
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_mutex_t {
fn hash(&self, state: &mut H) {
self.size.hash(state);
}
}
impl PartialEq for pthread_rwlock_t {
fn eq(&self, other: &pthread_rwlock_t) -> bool {
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_rwlock_t {}
impl ::fmt::Debug for pthread_rwlock_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_rwlock_t")
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_rwlock_t {
fn hash(&self, state: &mut H) {
self.size.hash(state);
}
}
}
}
};
}
libc-0.2.152/src/fuchsia/mod.rs 0000644 0000000 0000000 00000450500 10461020230 0014246 0 ustar 0000000 0000000 //! Definitions found commonly among almost all Unix derivatives
//!
//! More functions and definitions can be found in the more specific modules
//! according to the platform in question.
// PUB_TYPE
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type locale_t = *mut ::c_void;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type pid_t = i32;
pub type uid_t = u32;
pub type gid_t = u32;
pub type in_addr_t = u32;
pub type in_port_t = u16;
pub type sighandler_t = ::size_t;
pub type cc_t = ::c_uchar;
pub type sa_family_t = u16;
pub type pthread_key_t = ::c_uint;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type clockid_t = ::c_int;
pub type key_t = ::c_int;
pub type id_t = ::c_uint;
pub type useconds_t = u32;
pub type dev_t = u64;
pub type socklen_t = u32;
pub type pthread_t = c_ulong;
pub type mode_t = u32;
pub type ino64_t = u64;
pub type off64_t = i64;
pub type blkcnt64_t = i64;
pub type rlim64_t = u64;
pub type mqd_t = ::c_int;
pub type nfds_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type idtype_t = ::c_uint;
pub type loff_t = ::c_longlong;
pub type __u8 = ::c_uchar;
pub type __u16 = ::c_ushort;
pub type __s16 = ::c_short;
pub type __u32 = ::c_uint;
pub type __s32 = ::c_int;
pub type Elf32_Half = u16;
pub type Elf32_Word = u32;
pub type Elf32_Off = u32;
pub type Elf32_Addr = u32;
pub type Elf64_Half = u16;
pub type Elf64_Word = u32;
pub type Elf64_Off = u64;
pub type Elf64_Addr = u64;
pub type Elf64_Xword = u64;
pub type clock_t = c_long;
pub type time_t = c_long;
pub type suseconds_t = c_long;
pub type ino_t = u64;
pub type off_t = i64;
pub type blkcnt_t = i64;
pub type shmatt_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type msglen_t = ::c_ulong;
pub type fsblkcnt_t = ::c_ulonglong;
pub type fsfilcnt_t = ::c_ulonglong;
pub type rlim_t = ::c_ulonglong;
pub type c_long = i64;
pub type c_ulong = u64;
// FIXME: why are these uninhabited types? that seems... wrong?
// Presumably these should be `()` or an `extern type` (when that stabilizes).
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
impl ::Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum DIR {}
impl ::Copy for DIR {}
impl ::Clone for DIR {
fn clone(&self) -> DIR {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos64_t {} // FIXME: fill this out with a struct
impl ::Copy for fpos64_t {}
impl ::Clone for fpos64_t {
fn clone(&self) -> fpos64_t {
*self
}
}
// PUB_STRUCT
s! {
pub struct group {
pub gr_name: *mut ::c_char,
pub gr_passwd: *mut ::c_char,
pub gr_gid: ::gid_t,
pub gr_mem: *mut *mut ::c_char,
}
pub struct utimbuf {
pub actime: time_t,
pub modtime: time_t,
}
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: ::c_long,
}
// FIXME: the rlimit and rusage related functions and types don't exist
// within zircon. Are there reasons for keeping them around?
pub struct rlimit {
pub rlim_cur: rlim_t,
pub rlim_max: rlim_t,
}
pub struct rusage {
pub ru_utime: timeval,
pub ru_stime: timeval,
pub ru_maxrss: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad1: u32,
pub ru_ixrss: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad2: u32,
pub ru_idrss: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad3: u32,
pub ru_isrss: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad4: u32,
pub ru_minflt: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad5: u32,
pub ru_majflt: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad6: u32,
pub ru_nswap: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad7: u32,
pub ru_inblock: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad8: u32,
pub ru_oublock: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad9: u32,
pub ru_msgsnd: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad10: u32,
pub ru_msgrcv: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad11: u32,
pub ru_nsignals: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad12: u32,
pub ru_nvcsw: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad13: u32,
pub ru_nivcsw: c_long,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
__pad14: u32,
}
pub struct in_addr {
pub s_addr: in_addr_t,
}
pub struct in6_addr {
pub s6_addr: [u8; 16],
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: ::c_int,
}
pub struct ipv6_mreq {
pub ipv6mr_multiaddr: in6_addr,
pub ipv6mr_interface: ::c_uint,
}
pub struct hostent {
pub h_name: *mut ::c_char,
pub h_aliases: *mut *mut ::c_char,
pub h_addrtype: ::c_int,
pub h_length: ::c_int,
pub h_addr_list: *mut *mut ::c_char,
}
pub struct iovec {
pub iov_base: *mut ::c_void,
pub iov_len: ::size_t,
}
pub struct pollfd {
pub fd: ::c_int,
pub events: ::c_short,
pub revents: ::c_short,
}
pub struct winsize {
pub ws_row: ::c_ushort,
pub ws_col: ::c_ushort,
pub ws_xpixel: ::c_ushort,
pub ws_ypixel: ::c_ushort,
}
pub struct linger {
pub l_onoff: ::c_int,
pub l_linger: ::c_int,
}
pub struct sigval {
// Actually a union of an int and a void*
pub sival_ptr: *mut ::c_void
}
//
pub struct itimerval {
pub it_interval: ::timeval,
pub it_value: ::timeval,
}
//
pub struct tms {
pub tms_utime: ::clock_t,
pub tms_stime: ::clock_t,
pub tms_cutime: ::clock_t,
pub tms_cstime: ::clock_t,
}
pub struct servent {
pub s_name: *mut ::c_char,
pub s_aliases: *mut *mut ::c_char,
pub s_port: ::c_int,
pub s_proto: *mut ::c_char,
}
pub struct protoent {
pub p_name: *mut ::c_char,
pub p_aliases: *mut *mut ::c_char,
pub p_proto: ::c_int,
}
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
pub aio_sigevent: ::sigevent,
__td: *mut ::c_void,
__lock: [::c_int; 2],
__err: ::c_int,
__ret: ::ssize_t,
pub aio_offset: off_t,
__next: *mut ::c_void,
__prev: *mut ::c_void,
#[cfg(target_pointer_width = "32")]
__dummy4: [::c_char; 24],
#[cfg(target_pointer_width = "64")]
__dummy4: [::c_char; 16],
}
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
pub sa_restorer: ::Option,
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_line: ::cc_t,
pub c_cc: [::cc_t; ::NCCS],
pub __c_ispeed: ::speed_t,
pub __c_ospeed: ::speed_t,
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
}
pub struct ucred {
pub pid: ::pid_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
}
pub struct sockaddr {
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 14],
}
pub struct sockaddr_in {
pub sin_family: sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [u8; 8],
}
pub struct sockaddr_in6 {
pub sin6_family: sa_family_t,
pub sin6_port: ::in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: u32,
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: socklen_t,
pub ai_addr: *mut ::sockaddr,
pub ai_canonname: *mut c_char,
pub ai_next: *mut addrinfo,
}
pub struct sockaddr_ll {
pub sll_family: ::c_ushort,
pub sll_protocol: ::c_ushort,
pub sll_ifindex: ::c_int,
pub sll_hatype: ::c_ushort,
pub sll_pkttype: ::c_uchar,
pub sll_halen: ::c_uchar,
pub sll_addr: [::c_uchar; 8]
}
pub struct fd_set {
fds_bits: [::c_ulong; FD_SETSIZE / ULONG_SIZE],
}
pub struct tm {
pub tm_sec: ::c_int,
pub tm_min: ::c_int,
pub tm_hour: ::c_int,
pub tm_mday: ::c_int,
pub tm_mon: ::c_int,
pub tm_year: ::c_int,
pub tm_wday: ::c_int,
pub tm_yday: ::c_int,
pub tm_isdst: ::c_int,
pub tm_gmtoff: ::c_long,
pub tm_zone: *const ::c_char,
}
pub struct sched_param {
pub sched_priority: ::c_int,
pub sched_ss_low_priority: ::c_int,
pub sched_ss_repl_period: ::timespec,
pub sched_ss_init_budget: ::timespec,
pub sched_ss_max_repl: ::c_int,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *mut ::c_void,
}
pub struct epoll_event {
pub events: u32,
pub u64: u64,
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct rlimit64 {
pub rlim_cur: rlim64_t,
pub rlim_max: rlim64_t,
}
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_pathv: *mut *mut c_char,
pub gl_offs: ::size_t,
pub gl_flags: ::c_int,
__unused1: *mut ::c_void,
__unused2: *mut ::c_void,
__unused3: *mut ::c_void,
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
}
pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut c_char,
pub ifa_flags: ::c_uint,
pub ifa_addr: *mut ::sockaddr,
pub ifa_netmask: *mut ::sockaddr,
pub ifa_ifu: *mut ::sockaddr, // FIXME This should be a union
pub ifa_data: *mut ::c_void
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_gecos: *mut ::c_char,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char,
}
pub struct spwd {
pub sp_namp: *mut ::c_char,
pub sp_pwdp: *mut ::c_char,
pub sp_lstchg: ::c_long,
pub sp_min: ::c_long,
pub sp_max: ::c_long,
pub sp_warn: ::c_long,
pub sp_inact: ::c_long,
pub sp_expire: ::c_long,
pub sp_flag: ::c_ulong,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
#[cfg(target_endian = "little")]
pub f_fsid: ::c_ulong,
#[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))]
__f_unused: ::c_int,
#[cfg(target_endian = "big")]
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct dqblk {
pub dqb_bhardlimit: u64,
pub dqb_bsoftlimit: u64,
pub dqb_curspace: u64,
pub dqb_ihardlimit: u64,
pub dqb_isoftlimit: u64,
pub dqb_curinodes: u64,
pub dqb_btime: u64,
pub dqb_itime: u64,
pub dqb_valid: u32,
}
pub struct signalfd_siginfo {
pub ssi_signo: u32,
pub ssi_errno: i32,
pub ssi_code: i32,
pub ssi_pid: u32,
pub ssi_uid: u32,
pub ssi_fd: i32,
pub ssi_tid: u32,
pub ssi_band: u32,
pub ssi_overrun: u32,
pub ssi_trapno: u32,
pub ssi_status: i32,
pub ssi_int: i32,
pub ssi_ptr: u64,
pub ssi_utime: u64,
pub ssi_stime: u64,
pub ssi_addr: u64,
pub ssi_addr_lsb: u16,
_pad2: u16,
pub ssi_syscall: i32,
pub ssi_call_addr: u64,
pub ssi_arch: u32,
_pad: [u8; 28],
}
pub struct itimerspec {
pub it_interval: ::timespec,
pub it_value: ::timespec,
}
pub struct fsid_t {
__val: [::c_int; 2],
}
pub struct cpu_set_t {
#[cfg(all(target_pointer_width = "32",
not(target_arch = "x86_64")))]
bits: [u32; 32],
#[cfg(not(all(target_pointer_width = "32",
not(target_arch = "x86_64"))))]
bits: [u64; 16],
}
pub struct if_nameindex {
pub if_index: ::c_uint,
pub if_name: *mut ::c_char,
}
// System V IPC
pub struct msginfo {
pub msgpool: ::c_int,
pub msgmap: ::c_int,
pub msgmax: ::c_int,
pub msgmnb: ::c_int,
pub msgmni: ::c_int,
pub msgssz: ::c_int,
pub msgtql: ::c_int,
pub msgseg: ::c_ushort,
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
pub struct input_event {
pub time: ::timeval,
pub type_: ::__u16,
pub code: ::__u16,
pub value: ::__s32,
}
pub struct input_id {
pub bustype: ::__u16,
pub vendor: ::__u16,
pub product: ::__u16,
pub version: ::__u16,
}
pub struct input_absinfo {
pub value: ::__s32,
pub minimum: ::__s32,
pub maximum: ::__s32,
pub fuzz: ::__s32,
pub flat: ::__s32,
pub resolution: ::__s32,
}
pub struct input_keymap_entry {
pub flags: ::__u8,
pub len: ::__u8,
pub index: ::__u16,
pub keycode: ::__u32,
pub scancode: [::__u8; 32],
}
pub struct input_mask {
pub type_: ::__u32,
pub codes_size: ::__u32,
pub codes_ptr: ::__u64,
}
pub struct ff_replay {
pub length: ::__u16,
pub delay: ::__u16,
}
pub struct ff_trigger {
pub button: ::__u16,
pub interval: ::__u16,
}
pub struct ff_envelope {
pub attack_length: ::__u16,
pub attack_level: ::__u16,
pub fade_length: ::__u16,
pub fade_level: ::__u16,
}
pub struct ff_constant_effect {
pub level: ::__s16,
pub envelope: ff_envelope,
}
pub struct ff_ramp_effect {
pub start_level: ::__s16,
pub end_level: ::__s16,
pub envelope: ff_envelope,
}
pub struct ff_condition_effect {
pub right_saturation: ::__u16,
pub left_saturation: ::__u16,
pub right_coeff: ::__s16,
pub left_coeff: ::__s16,
pub deadband: ::__u16,
pub center: ::__s16,
}
pub struct ff_periodic_effect {
pub waveform: ::__u16,
pub period: ::__u16,
pub magnitude: ::__s16,
pub offset: ::__s16,
pub phase: ::__u16,
pub envelope: ff_envelope,
pub custom_len: ::__u32,
pub custom_data: *mut ::__s16,
}
pub struct ff_rumble_effect {
pub strong_magnitude: ::__u16,
pub weak_magnitude: ::__u16,
}
pub struct ff_effect {
pub type_: ::__u16,
pub id: ::__s16,
pub direction: ::__u16,
pub trigger: ff_trigger,
pub replay: ff_replay,
// FIXME this is actually a union
#[cfg(target_pointer_width = "64")]
pub u: [u64; 4],
#[cfg(target_pointer_width = "32")]
pub u: [u32; 7],
}
pub struct dl_phdr_info {
#[cfg(target_pointer_width = "64")]
pub dlpi_addr: Elf64_Addr,
#[cfg(target_pointer_width = "32")]
pub dlpi_addr: Elf32_Addr,
pub dlpi_name: *const ::c_char,
#[cfg(target_pointer_width = "64")]
pub dlpi_phdr: *const Elf64_Phdr,
#[cfg(target_pointer_width = "32")]
pub dlpi_phdr: *const Elf32_Phdr,
#[cfg(target_pointer_width = "64")]
pub dlpi_phnum: Elf64_Half,
#[cfg(target_pointer_width = "32")]
pub dlpi_phnum: Elf32_Half,
pub dlpi_adds: ::c_ulonglong,
pub dlpi_subs: ::c_ulonglong,
pub dlpi_tls_modid: ::size_t,
pub dlpi_tls_data: *mut ::c_void,
}
pub struct Elf32_Phdr {
pub p_type: Elf32_Word,
pub p_offset: Elf32_Off,
pub p_vaddr: Elf32_Addr,
pub p_paddr: Elf32_Addr,
pub p_filesz: Elf32_Word,
pub p_memsz: Elf32_Word,
pub p_flags: Elf32_Word,
pub p_align: Elf32_Word,
}
pub struct Elf64_Phdr {
pub p_type: Elf64_Word,
pub p_flags: Elf64_Word,
pub p_offset: Elf64_Off,
pub p_vaddr: Elf64_Addr,
pub p_paddr: Elf64_Addr,
pub p_filesz: Elf64_Xword,
pub p_memsz: Elf64_Xword,
pub p_align: Elf64_Xword,
}
pub struct statfs64 {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}
pub struct statvfs64 {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_favail: u64,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
__f_spare: [::c_int; 6],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_flags: ::c_int,
pub ss_size: ::size_t
}
pub struct pthread_attr_t {
__size: [u64; 7]
}
pub struct sigset_t {
__val: [::c_ulong; 16],
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
pub shm_cpid: ::pid_t,
pub shm_lpid: ::pid_t,
pub shm_nattch: ::c_ulong,
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
__msg_cbytes: ::c_ulong,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
__pad1: ::c_ulong,
__pad2: ::c_ulong,
}
pub struct statfs {
pub f_type: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_fsid: ::fsid_t,
pub f_namelen: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_flags: ::c_ulong,
pub f_spare: [::c_ulong; 4],
}
pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
__pad1: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: ::socklen_t,
__pad2: ::socklen_t,
pub msg_flags: ::c_int,
}
pub struct cmsghdr {
pub cmsg_len: ::socklen_t,
pub __pad1: ::c_int,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
pub struct sem_t {
__val: [::c_int; 8],
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub _pad: [::c_int; 29],
_align: [usize; 0],
}
pub struct termios2 {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_line: ::cc_t,
pub c_cc: [::cc_t; 19],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
pub struct in6_pktinfo {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_uint,
}
}
s_no_extra_traits! {
pub struct sysinfo {
pub uptime: ::c_ulong,
pub loads: [::c_ulong; 3],
pub totalram: ::c_ulong,
pub freeram: ::c_ulong,
pub sharedram: ::c_ulong,
pub bufferram: ::c_ulong,
pub totalswap: ::c_ulong,
pub freeswap: ::c_ulong,
pub procs: ::c_ushort,
pub pad: ::c_ushort,
pub totalhigh: ::c_ulong,
pub freehigh: ::c_ulong,
pub mem_unit: ::c_uint,
pub __reserved: [::c_char; 256],
}
pub struct sockaddr_un {
pub sun_family: sa_family_t,
pub sun_path: [::c_char; 108]
}
pub struct sockaddr_storage {
pub ss_family: sa_family_t,
__ss_pad2: [u8; 128 - 2 - 8],
__ss_align: ::size_t,
}
pub struct utsname {
pub sysname: [::c_char; 65],
pub nodename: [::c_char; 65],
pub release: [::c_char; 65],
pub version: [::c_char; 65],
pub machine: [::c_char; 65],
pub domainname: [::c_char; 65]
}
pub struct dirent {
pub d_ino: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: ::c_ushort,
pub d_type: ::c_uchar,
pub d_name: [::c_char; 256],
}
pub struct dirent64 {
pub d_ino: ::ino64_t,
pub d_off: ::off64_t,
pub d_reclen: ::c_ushort,
pub d_type: ::c_uchar,
pub d_name: [::c_char; 256],
}
// x32 compatibility
// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
pub struct mq_attr {
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub mq_flags: i64,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub mq_maxmsg: i64,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub mq_msgsize: i64,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pub mq_curmsgs: i64,
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
pad: [i64; 4],
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_flags: ::c_long,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_maxmsg: ::c_long,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_msgsize: ::c_long,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pub mq_curmsgs: ::c_long,
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
pad: [::c_long; 4],
}
pub struct sockaddr_nl {
pub nl_family: ::sa_family_t,
nl_pad: ::c_ushort,
pub nl_pid: u32,
pub nl_groups: u32
}
pub struct sigevent {
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
pub sigev_notify_function: fn(::sigval),
pub sigev_notify_attributes: *mut pthread_attr_t,
pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for sysinfo {
fn eq(&self, other: &sysinfo) -> bool {
self.uptime == other.uptime
&& self.loads == other.loads
&& self.totalram == other.totalram
&& self.freeram == other.freeram
&& self.sharedram == other.sharedram
&& self.bufferram == other.bufferram
&& self.totalswap == other.totalswap
&& self.freeswap == other.freeswap
&& self.procs == other.procs
&& self.pad == other.pad
&& self.totalhigh == other.totalhigh
&& self.freehigh == other.freehigh
&& self.mem_unit == other.mem_unit
&& self
.__reserved
.iter()
.zip(other.__reserved.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sysinfo {}
impl ::fmt::Debug for sysinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sysinfo")
.field("uptime", &self.uptime)
.field("loads", &self.loads)
.field("totalram", &self.totalram)
.field("freeram", &self.freeram)
.field("sharedram", &self.sharedram)
.field("bufferram", &self.bufferram)
.field("totalswap", &self.totalswap)
.field("freeswap", &self.freeswap)
.field("procs", &self.procs)
.field("pad", &self.pad)
.field("totalhigh", &self.totalhigh)
.field("freehigh", &self.freehigh)
.field("mem_unit", &self.mem_unit)
// FIXME: .field("__reserved", &self.__reserved)
.finish()
}
}
impl ::hash::Hash for sysinfo {
fn hash(&self, state: &mut H) {
self.uptime.hash(state);
self.loads.hash(state);
self.totalram.hash(state);
self.freeram.hash(state);
self.sharedram.hash(state);
self.bufferram.hash(state);
self.totalswap.hash(state);
self.freeswap.hash(state);
self.procs.hash(state);
self.pad.hash(state);
self.totalhigh.hash(state);
self.freehigh.hash(state);
self.mem_unit.hash(state);
self.__reserved.hash(state);
}
}
impl PartialEq for sockaddr_un {
fn eq(&self, other: &sockaddr_un) -> bool {
self.sun_family == other.sun_family
&& self
.sun_path
.iter()
.zip(other.sun_path.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sockaddr_un {}
impl ::fmt::Debug for sockaddr_un {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_un")
.field("sun_family", &self.sun_family)
// FIXME: .field("sun_path", &self.sun_path)
.finish()
}
}
impl ::hash::Hash for sockaddr_un {
fn hash(&self, state: &mut H) {
self.sun_family.hash(state);
self.sun_path.hash(state);
}
}
impl PartialEq for sockaddr_storage {
fn eq(&self, other: &sockaddr_storage) -> bool {
self.ss_family == other.ss_family
&& self.__ss_align == other.__ss_align
&& self
.__ss_pad2
.iter()
.zip(other.__ss_pad2.iter())
.all(|(a, b)| a == b)
}
}
impl Eq for sockaddr_storage {}
impl ::fmt::Debug for sockaddr_storage {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_storage")
.field("ss_family", &self.ss_family)
.field("__ss_align", &self.__ss_align)
// FIXME: .field("__ss_pad2", &self.__ss_pad2)
.finish()
}
}
impl ::hash::Hash for sockaddr_storage {
fn hash(&self, state: &mut H) {
self.ss_family.hash(state);
self.__ss_align.hash(state);
self.__ss_pad2.hash(state);
}
}
impl PartialEq for utsname {
fn eq(&self, other: &utsname) -> bool {
self.sysname
.iter()
.zip(other.sysname.iter())
.all(|(a,b)| a == b)
&& self
.nodename
.iter()
.zip(other.nodename.iter())
.all(|(a,b)| a == b)
&& self
.release
.iter()
.zip(other.release.iter())
.all(|(a,b)| a == b)
&& self
.version
.iter()
.zip(other.version.iter())
.all(|(a,b)| a == b)
&& self
.machine
.iter()
.zip(other.machine.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for utsname {}
impl ::fmt::Debug for utsname {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utsname")
// FIXME: .field("sysname", &self.sysname)
// FIXME: .field("nodename", &self.nodename)
// FIXME: .field("release", &self.release)
// FIXME: .field("version", &self.version)
// FIXME: .field("machine", &self.machine)
.finish()
}
}
impl ::hash::Hash for utsname {
fn hash(&self, state: &mut H) {
self.sysname.hash(state);
self.nodename.hash(state);
self.release.hash(state);
self.version.hash(state);
self.machine.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_ino", &self.d_ino)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_ino.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_name.hash(state);
}
}
impl PartialEq for dirent64 {
fn eq(&self, other: &dirent64) -> bool {
self.d_ino == other.d_ino
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent64 {}
impl ::fmt::Debug for dirent64 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent64")
.field("d_ino", &self.d_ino)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent64 {
fn hash(&self, state: &mut H) {
self.d_ino.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_name.hash(state);
}
}
impl PartialEq for mq_attr {
fn eq(&self, other: &mq_attr) -> bool {
self.mq_flags == other.mq_flags &&
self.mq_maxmsg == other.mq_maxmsg &&
self.mq_msgsize == other.mq_msgsize &&
self.mq_curmsgs == other.mq_curmsgs
}
}
impl Eq for mq_attr {}
impl ::fmt::Debug for mq_attr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mq_attr")
.field("mq_flags", &self.mq_flags)
.field("mq_maxmsg", &self.mq_maxmsg)
.field("mq_msgsize", &self.mq_msgsize)
.field("mq_curmsgs", &self.mq_curmsgs)
.finish()
}
}
impl ::hash::Hash for mq_attr {
fn hash(&self, state: &mut H) {
self.mq_flags.hash(state);
self.mq_maxmsg.hash(state);
self.mq_msgsize.hash(state);
self.mq_curmsgs.hash(state);
}
}
impl PartialEq for sockaddr_nl {
fn eq(&self, other: &sockaddr_nl) -> bool {
self.nl_family == other.nl_family &&
self.nl_pid == other.nl_pid &&
self.nl_groups == other.nl_groups
}
}
impl Eq for sockaddr_nl {}
impl ::fmt::Debug for sockaddr_nl {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_nl")
.field("nl_family", &self.nl_family)
.field("nl_pid", &self.nl_pid)
.field("nl_groups", &self.nl_groups)
.finish()
}
}
impl ::hash::Hash for sockaddr_nl {
fn hash(&self, state: &mut H) {
self.nl_family.hash(state);
self.nl_pid.hash(state);
self.nl_groups.hash(state);
}
}
impl PartialEq for sigevent {
fn eq(&self, other: &sigevent) -> bool {
self.sigev_value == other.sigev_value
&& self.sigev_signo == other.sigev_signo
&& self.sigev_notify == other.sigev_notify
&& self.sigev_notify_function
== other.sigev_notify_function
&& self.sigev_notify_attributes
== other.sigev_notify_attributes
}
}
impl Eq for sigevent {}
impl ::fmt::Debug for sigevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigevent")
.field("sigev_value", &self.sigev_value)
.field("sigev_signo", &self.sigev_signo)
.field("sigev_notify", &self.sigev_notify)
.field("sigev_notify_function", &self.sigev_notify_function)
.field("sigev_notify_attributes",
&self.sigev_notify_attributes)
.finish()
}
}
impl ::hash::Hash for sigevent {
fn hash(&self, state: &mut H) {
self.sigev_value.hash(state);
self.sigev_signo.hash(state);
self.sigev_notify.hash(state);
self.sigev_notify_function.hash(state);
self.sigev_notify_attributes.hash(state);
}
}
}
}
// PUB_CONST
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;
pub const SIG_IGN: sighandler_t = 1 as sighandler_t;
pub const SIG_ERR: sighandler_t = !0 as sighandler_t;
pub const DT_UNKNOWN: u8 = 0;
pub const DT_FIFO: u8 = 1;
pub const DT_CHR: u8 = 2;
pub const DT_DIR: u8 = 4;
pub const DT_BLK: u8 = 6;
pub const DT_REG: u8 = 8;
pub const DT_LNK: u8 = 10;
pub const DT_SOCK: u8 = 12;
pub const FD_CLOEXEC: ::c_int = 0x1;
pub const USRQUOTA: ::c_int = 0;
pub const GRPQUOTA: ::c_int = 1;
pub const SIGIOT: ::c_int = 6;
pub const S_ISUID: ::c_int = 0x800;
pub const S_ISGID: ::c_int = 0x400;
pub const S_ISVTX: ::c_int = 0x200;
pub const IF_NAMESIZE: ::size_t = 16;
pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
pub const LOG_EMERG: ::c_int = 0;
pub const LOG_ALERT: ::c_int = 1;
pub const LOG_CRIT: ::c_int = 2;
pub const LOG_ERR: ::c_int = 3;
pub const LOG_WARNING: ::c_int = 4;
pub const LOG_NOTICE: ::c_int = 5;
pub const LOG_INFO: ::c_int = 6;
pub const LOG_DEBUG: ::c_int = 7;
pub const LOG_KERN: ::c_int = 0;
pub const LOG_USER: ::c_int = 1 << 3;
pub const LOG_MAIL: ::c_int = 2 << 3;
pub const LOG_DAEMON: ::c_int = 3 << 3;
pub const LOG_AUTH: ::c_int = 4 << 3;
pub const LOG_SYSLOG: ::c_int = 5 << 3;
pub const LOG_LPR: ::c_int = 6 << 3;
pub const LOG_NEWS: ::c_int = 7 << 3;
pub const LOG_UUCP: ::c_int = 8 << 3;
pub const LOG_LOCAL0: ::c_int = 16 << 3;
pub const LOG_LOCAL1: ::c_int = 17 << 3;
pub const LOG_LOCAL2: ::c_int = 18 << 3;
pub const LOG_LOCAL3: ::c_int = 19 << 3;
pub const LOG_LOCAL4: ::c_int = 20 << 3;
pub const LOG_LOCAL5: ::c_int = 21 << 3;
pub const LOG_LOCAL6: ::c_int = 22 << 3;
pub const LOG_LOCAL7: ::c_int = 23 << 3;
pub const LOG_PID: ::c_int = 0x01;
pub const LOG_CONS: ::c_int = 0x02;
pub const LOG_ODELAY: ::c_int = 0x04;
pub const LOG_NDELAY: ::c_int = 0x08;
pub const LOG_NOWAIT: ::c_int = 0x10;
pub const LOG_PRIMASK: ::c_int = 7;
pub const LOG_FACMASK: ::c_int = 0x3f8;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
pub const PRIO_MIN: ::c_int = -20;
pub const PRIO_MAX: ::c_int = 20;
pub const IPPROTO_ICMP: ::c_int = 1;
pub const IPPROTO_ICMPV6: ::c_int = 58;
pub const IPPROTO_TCP: ::c_int = 6;
pub const IPPROTO_UDP: ::c_int = 17;
pub const IPPROTO_IP: ::c_int = 0;
pub const IPPROTO_IPV6: ::c_int = 41;
pub const INADDR_LOOPBACK: in_addr_t = 2130706433;
pub const INADDR_ANY: in_addr_t = 0;
pub const INADDR_BROADCAST: in_addr_t = 4294967295;
pub const INADDR_NONE: in_addr_t = 4294967295;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const RAND_MAX: ::c_int = 2147483647;
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
// Linux-specific fcntls
pub const F_SETLEASE: ::c_int = 1024;
pub const F_GETLEASE: ::c_int = 1025;
pub const F_NOTIFY: ::c_int = 1026;
pub const F_CANCELLK: ::c_int = 1029;
pub const F_DUPFD_CLOEXEC: ::c_int = 1030;
pub const F_SETPIPE_SZ: ::c_int = 1031;
pub const F_GETPIPE_SZ: ::c_int = 1032;
pub const F_ADD_SEALS: ::c_int = 1033;
pub const F_GET_SEALS: ::c_int = 1034;
pub const F_SEAL_SEAL: ::c_int = 0x0001;
pub const F_SEAL_SHRINK: ::c_int = 0x0002;
pub const F_SEAL_GROW: ::c_int = 0x0004;
pub const F_SEAL_WRITE: ::c_int = 0x0008;
// FIXME(#235): Include file sealing fcntls once we have a way to verify them.
pub const SIGTRAP: ::c_int = 5;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_MONOTONIC: ::clockid_t = 1;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 2;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 3;
pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
pub const CLOCK_REALTIME_COARSE: ::clockid_t = 5;
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = 6;
pub const CLOCK_BOOTTIME: ::clockid_t = 7;
pub const CLOCK_REALTIME_ALARM: ::clockid_t = 8;
pub const CLOCK_BOOTTIME_ALARM: ::clockid_t = 9;
pub const CLOCK_SGI_CYCLE: ::clockid_t = 10;
pub const CLOCK_TAI: ::clockid_t = 11;
pub const TIMER_ABSTIME: ::c_int = 1;
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_LOCKS: ::c_int = 10;
pub const RLIMIT_SIGPENDING: ::c_int = 11;
pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RUSAGE_SELF: ::c_int = 0;
pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
pub const S_IFIFO: ::mode_t = 4096;
pub const S_IFCHR: ::mode_t = 8192;
pub const S_IFBLK: ::mode_t = 24576;
pub const S_IFDIR: ::mode_t = 16384;
pub const S_IFREG: ::mode_t = 32768;
pub const S_IFLNK: ::mode_t = 40960;
pub const S_IFSOCK: ::mode_t = 49152;
pub const S_IFMT: ::mode_t = 61440;
pub const S_IRWXU: ::mode_t = 448;
pub const S_IXUSR: ::mode_t = 64;
pub const S_IWUSR: ::mode_t = 128;
pub const S_IRUSR: ::mode_t = 256;
pub const S_IRWXG: ::mode_t = 56;
pub const S_IXGRP: ::mode_t = 8;
pub const S_IWGRP: ::mode_t = 16;
pub const S_IRGRP: ::mode_t = 32;
pub const S_IRWXO: ::mode_t = 7;
pub const S_IXOTH: ::mode_t = 1;
pub const S_IWOTH: ::mode_t = 2;
pub const S_IROTH: ::mode_t = 4;
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const LC_CTYPE: ::c_int = 0;
pub const LC_NUMERIC: ::c_int = 1;
pub const LC_TIME: ::c_int = 2;
pub const LC_COLLATE: ::c_int = 3;
pub const LC_MONETARY: ::c_int = 4;
pub const LC_MESSAGES: ::c_int = 5;
pub const LC_ALL: ::c_int = 6;
pub const LC_CTYPE_MASK: ::c_int = 1 << LC_CTYPE;
pub const LC_NUMERIC_MASK: ::c_int = 1 << LC_NUMERIC;
pub const LC_TIME_MASK: ::c_int = 1 << LC_TIME;
pub const LC_COLLATE_MASK: ::c_int = 1 << LC_COLLATE;
pub const LC_MONETARY_MASK: ::c_int = 1 << LC_MONETARY;
pub const LC_MESSAGES_MASK: ::c_int = 1 << LC_MESSAGES;
// LC_ALL_MASK defined per platform
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
// MS_ flags for msync(2)
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
pub const MS_SYNC: ::c_int = 0x0004;
// MS_ flags for mount(2)
pub const MS_RDONLY: ::c_ulong = 0x01;
pub const MS_NOSUID: ::c_ulong = 0x02;
pub const MS_NODEV: ::c_ulong = 0x04;
pub const MS_NOEXEC: ::c_ulong = 0x08;
pub const MS_SYNCHRONOUS: ::c_ulong = 0x10;
pub const MS_REMOUNT: ::c_ulong = 0x20;
pub const MS_MANDLOCK: ::c_ulong = 0x40;
pub const MS_DIRSYNC: ::c_ulong = 0x80;
pub const MS_NOATIME: ::c_ulong = 0x0400;
pub const MS_NODIRATIME: ::c_ulong = 0x0800;
pub const MS_BIND: ::c_ulong = 0x1000;
pub const MS_MOVE: ::c_ulong = 0x2000;
pub const MS_REC: ::c_ulong = 0x4000;
pub const MS_SILENT: ::c_ulong = 0x8000;
pub const MS_POSIXACL: ::c_ulong = 0x010000;
pub const MS_UNBINDABLE: ::c_ulong = 0x020000;
pub const MS_PRIVATE: ::c_ulong = 0x040000;
pub const MS_SLAVE: ::c_ulong = 0x080000;
pub const MS_SHARED: ::c_ulong = 0x100000;
pub const MS_RELATIME: ::c_ulong = 0x200000;
pub const MS_KERNMOUNT: ::c_ulong = 0x400000;
pub const MS_I_VERSION: ::c_ulong = 0x800000;
pub const MS_STRICTATIME: ::c_ulong = 0x1000000;
pub const MS_ACTIVE: ::c_ulong = 0x40000000;
pub const MS_NOUSER: ::c_ulong = 0x80000000;
pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
pub const MS_RMT_MASK: ::c_ulong = 0x800051;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EAGAIN: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const SCM_CREDENTIALS: ::c_int = 0x02;
pub const PROT_GROWSDOWN: ::c_int = 0x1000000;
pub const PROT_GROWSUP: ::c_int = 0x2000000;
pub const MAP_TYPE: ::c_int = 0x000f;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 8;
pub const MADV_REMOVE: ::c_int = 9;
pub const MADV_DONTFORK: ::c_int = 10;
pub const MADV_DOFORK: ::c_int = 11;
pub const MADV_MERGEABLE: ::c_int = 12;
pub const MADV_UNMERGEABLE: ::c_int = 13;
pub const MADV_HUGEPAGE: ::c_int = 14;
pub const MADV_NOHUGEPAGE: ::c_int = 15;
pub const MADV_DONTDUMP: ::c_int = 16;
pub const MADV_DODUMP: ::c_int = 17;
pub const MADV_HWPOISON: ::c_int = 100;
pub const MADV_SOFT_OFFLINE: ::c_int = 101;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;
pub const IFF_DEBUG: ::c_int = 0x4;
pub const IFF_LOOPBACK: ::c_int = 0x8;
pub const IFF_POINTOPOINT: ::c_int = 0x10;
pub const IFF_NOTRAILERS: ::c_int = 0x20;
pub const IFF_RUNNING: ::c_int = 0x40;
pub const IFF_NOARP: ::c_int = 0x80;
pub const IFF_PROMISC: ::c_int = 0x100;
pub const IFF_ALLMULTI: ::c_int = 0x200;
pub const IFF_MASTER: ::c_int = 0x400;
pub const IFF_SLAVE: ::c_int = 0x800;
pub const IFF_MULTICAST: ::c_int = 0x1000;
pub const IFF_PORTSEL: ::c_int = 0x2000;
pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
pub const IFF_DYNAMIC: ::c_int = 0x8000;
pub const IFF_TUN: ::c_int = 0x0001;
pub const IFF_TAP: ::c_int = 0x0002;
pub const IFF_NO_PI: ::c_int = 0x1000;
pub const SOL_IP: ::c_int = 0;
pub const SOL_TCP: ::c_int = 6;
pub const SOL_UDP: ::c_int = 17;
pub const SOL_IPV6: ::c_int = 41;
pub const SOL_ICMPV6: ::c_int = 58;
pub const SOL_RAW: ::c_int = 255;
pub const SOL_DECNET: ::c_int = 261;
pub const SOL_X25: ::c_int = 262;
pub const SOL_PACKET: ::c_int = 263;
pub const SOL_ATM: ::c_int = 264;
pub const SOL_AAL: ::c_int = 265;
pub const SOL_IRDA: ::c_int = 266;
pub const SOL_NETBEUI: ::c_int = 267;
pub const SOL_LLC: ::c_int = 268;
pub const SOL_DCCP: ::c_int = 269;
pub const SOL_NETLINK: ::c_int = 270;
pub const SOL_TIPC: ::c_int = 271;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_UNIX: ::c_int = 1;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_INET: ::c_int = 2;
pub const AF_AX25: ::c_int = 3;
pub const AF_IPX: ::c_int = 4;
pub const AF_APPLETALK: ::c_int = 5;
pub const AF_NETROM: ::c_int = 6;
pub const AF_BRIDGE: ::c_int = 7;
pub const AF_ATMPVC: ::c_int = 8;
pub const AF_X25: ::c_int = 9;
pub const AF_INET6: ::c_int = 10;
pub const AF_ROSE: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_NETBEUI: ::c_int = 13;
pub const AF_SECURITY: ::c_int = 14;
pub const AF_KEY: ::c_int = 15;
pub const AF_NETLINK: ::c_int = 16;
pub const AF_ROUTE: ::c_int = AF_NETLINK;
pub const AF_PACKET: ::c_int = 17;
pub const AF_ASH: ::c_int = 18;
pub const AF_ECONET: ::c_int = 19;
pub const AF_ATMSVC: ::c_int = 20;
pub const AF_RDS: ::c_int = 21;
pub const AF_SNA: ::c_int = 22;
pub const AF_IRDA: ::c_int = 23;
pub const AF_PPPOX: ::c_int = 24;
pub const AF_WANPIPE: ::c_int = 25;
pub const AF_LLC: ::c_int = 26;
pub const AF_CAN: ::c_int = 29;
pub const AF_TIPC: ::c_int = 30;
pub const AF_BLUETOOTH: ::c_int = 31;
pub const AF_IUCV: ::c_int = 32;
pub const AF_RXRPC: ::c_int = 33;
pub const AF_ISDN: ::c_int = 34;
pub const AF_PHONET: ::c_int = 35;
pub const AF_IEEE802154: ::c_int = 36;
pub const AF_CAIF: ::c_int = 37;
pub const AF_ALG: ::c_int = 38;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_UNIX: ::c_int = AF_UNIX;
pub const PF_LOCAL: ::c_int = AF_LOCAL;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_AX25: ::c_int = AF_AX25;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_NETROM: ::c_int = AF_NETROM;
pub const PF_BRIDGE: ::c_int = AF_BRIDGE;
pub const PF_ATMPVC: ::c_int = AF_ATMPVC;
pub const PF_X25: ::c_int = AF_X25;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_ROSE: ::c_int = AF_ROSE;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_NETBEUI: ::c_int = AF_NETBEUI;
pub const PF_SECURITY: ::c_int = AF_SECURITY;
pub const PF_KEY: ::c_int = AF_KEY;
pub const PF_NETLINK: ::c_int = AF_NETLINK;
pub const PF_ROUTE: ::c_int = AF_ROUTE;
pub const PF_PACKET: ::c_int = AF_PACKET;
pub const PF_ASH: ::c_int = AF_ASH;
pub const PF_ECONET: ::c_int = AF_ECONET;
pub const PF_ATMSVC: ::c_int = AF_ATMSVC;
pub const PF_RDS: ::c_int = AF_RDS;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_IRDA: ::c_int = AF_IRDA;
pub const PF_PPPOX: ::c_int = AF_PPPOX;
pub const PF_WANPIPE: ::c_int = AF_WANPIPE;
pub const PF_LLC: ::c_int = AF_LLC;
pub const PF_CAN: ::c_int = AF_CAN;
pub const PF_TIPC: ::c_int = AF_TIPC;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const PF_IUCV: ::c_int = AF_IUCV;
pub const PF_RXRPC: ::c_int = AF_RXRPC;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_PHONET: ::c_int = AF_PHONET;
pub const PF_IEEE802154: ::c_int = AF_IEEE802154;
pub const PF_CAIF: ::c_int = AF_CAIF;
pub const PF_ALG: ::c_int = AF_ALG;
pub const SOMAXCONN: ::c_int = 128;
pub const MSG_OOB: ::c_int = 1;
pub const MSG_PEEK: ::c_int = 2;
pub const MSG_DONTROUTE: ::c_int = 4;
pub const MSG_CTRUNC: ::c_int = 8;
pub const MSG_TRUNC: ::c_int = 0x20;
pub const MSG_DONTWAIT: ::c_int = 0x40;
pub const MSG_EOR: ::c_int = 0x80;
pub const MSG_WAITALL: ::c_int = 0x100;
pub const MSG_FIN: ::c_int = 0x200;
pub const MSG_SYN: ::c_int = 0x400;
pub const MSG_CONFIRM: ::c_int = 0x800;
pub const MSG_RST: ::c_int = 0x1000;
pub const MSG_ERRQUEUE: ::c_int = 0x2000;
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
pub const MSG_MORE: ::c_int = 0x8000;
pub const MSG_WAITFORONE: ::c_int = 0x10000;
pub const MSG_FASTOPEN: ::c_int = 0x20000000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
pub const SCM_TIMESTAMP: ::c_int = SO_TIMESTAMP;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const IP_TOS: ::c_int = 1;
pub const IP_TTL: ::c_int = 2;
pub const IP_HDRINCL: ::c_int = 3;
pub const IP_RECVTOS: ::c_int = 13;
pub const IP_FREEBIND: ::c_int = 15;
pub const IP_TRANSPARENT: ::c_int = 19;
pub const IP_MULTICAST_IF: ::c_int = 32;
pub const IP_MULTICAST_TTL: ::c_int = 33;
pub const IP_MULTICAST_LOOP: ::c_int = 34;
pub const IP_ADD_MEMBERSHIP: ::c_int = 35;
pub const IP_DROP_MEMBERSHIP: ::c_int = 36;
pub const IPV6_UNICAST_HOPS: ::c_int = 16;
pub const IPV6_MULTICAST_IF: ::c_int = 17;
pub const IPV6_MULTICAST_HOPS: ::c_int = 18;
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;
pub const IPV6_ADD_MEMBERSHIP: ::c_int = 20;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = 21;
pub const IPV6_V6ONLY: ::c_int = 26;
pub const IPV6_RECVPKTINFO: ::c_int = 49;
pub const IPV6_RECVTCLASS: ::c_int = 66;
pub const IPV6_TCLASS: ::c_int = 67;
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const TCP_CORK: ::c_int = 3;
pub const TCP_KEEPIDLE: ::c_int = 4;
pub const TCP_KEEPINTVL: ::c_int = 5;
pub const TCP_KEEPCNT: ::c_int = 6;
pub const TCP_SYNCNT: ::c_int = 7;
pub const TCP_LINGER2: ::c_int = 8;
pub const TCP_DEFER_ACCEPT: ::c_int = 9;
pub const TCP_WINDOW_CLAMP: ::c_int = 10;
pub const TCP_INFO: ::c_int = 11;
pub const TCP_QUICKACK: ::c_int = 12;
pub const TCP_CONGESTION: ::c_int = 13;
pub const SO_DEBUG: ::c_int = 1;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
pub const SS_ONSTACK: ::c_int = 1;
pub const SS_DISABLE: ::c_int = 2;
pub const PATH_MAX: ::c_int = 4096;
pub const FD_SETSIZE: usize = 1024;
pub const EPOLLIN: ::c_int = 0x1;
pub const EPOLLPRI: ::c_int = 0x2;
pub const EPOLLOUT: ::c_int = 0x4;
pub const EPOLLRDNORM: ::c_int = 0x40;
pub const EPOLLRDBAND: ::c_int = 0x80;
pub const EPOLLWRNORM: ::c_int = 0x100;
pub const EPOLLWRBAND: ::c_int = 0x200;
pub const EPOLLMSG: ::c_int = 0x400;
pub const EPOLLERR: ::c_int = 0x8;
pub const EPOLLHUP: ::c_int = 0x10;
pub const EPOLLET: ::c_int = 0x80000000;
pub const EPOLL_CTL_ADD: ::c_int = 1;
pub const EPOLL_CTL_MOD: ::c_int = 3;
pub const EPOLL_CTL_DEL: ::c_int = 2;
pub const MNT_DETACH: ::c_int = 0x2;
pub const MNT_EXPIRE: ::c_int = 0x4;
pub const Q_GETFMT: ::c_int = 0x800004;
pub const Q_GETINFO: ::c_int = 0x800005;
pub const Q_SETINFO: ::c_int = 0x800006;
pub const QIF_BLIMITS: u32 = 1;
pub const QIF_SPACE: u32 = 2;
pub const QIF_ILIMITS: u32 = 4;
pub const QIF_INODES: u32 = 8;
pub const QIF_BTIME: u32 = 16;
pub const QIF_ITIME: u32 = 32;
pub const QIF_LIMITS: u32 = 5;
pub const QIF_USAGE: u32 = 10;
pub const QIF_TIMES: u32 = 48;
pub const QIF_ALL: u32 = 63;
pub const MNT_FORCE: ::c_int = 0x1;
pub const Q_SYNC: ::c_int = 0x800001;
pub const Q_QUOTAON: ::c_int = 0x800002;
pub const Q_QUOTAOFF: ::c_int = 0x800003;
pub const Q_GETQUOTA: ::c_int = 0x800007;
pub const Q_SETQUOTA: ::c_int = 0x800008;
pub const TCIOFF: ::c_int = 2;
pub const TCION: ::c_int = 3;
pub const TCOOFF: ::c_int = 0;
pub const TCOON: ::c_int = 1;
pub const TCIFLUSH: ::c_int = 0;
pub const TCOFLUSH: ::c_int = 1;
pub const TCIOFLUSH: ::c_int = 2;
pub const NL0: ::c_int = 0x00000000;
pub const NL1: ::c_int = 0x00000100;
pub const TAB0: ::c_int = 0x00000000;
pub const CR0: ::c_int = 0x00000000;
pub const FF0: ::c_int = 0x00000000;
pub const BS0: ::c_int = 0x00000000;
pub const VT0: ::c_int = 0x00000000;
pub const VERASE: usize = 2;
pub const VKILL: usize = 3;
pub const VINTR: usize = 0;
pub const VQUIT: usize = 1;
pub const VLNEXT: usize = 15;
pub const IGNBRK: ::tcflag_t = 0x00000001;
pub const BRKINT: ::tcflag_t = 0x00000002;
pub const IGNPAR: ::tcflag_t = 0x00000004;
pub const PARMRK: ::tcflag_t = 0x00000008;
pub const INPCK: ::tcflag_t = 0x00000010;
pub const ISTRIP: ::tcflag_t = 0x00000020;
pub const INLCR: ::tcflag_t = 0x00000040;
pub const IGNCR: ::tcflag_t = 0x00000080;
pub const ICRNL: ::tcflag_t = 0x00000100;
pub const IXANY: ::tcflag_t = 0x00000800;
pub const IMAXBEL: ::tcflag_t = 0x00002000;
pub const OPOST: ::tcflag_t = 0x1;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CRTSCTS: ::tcflag_t = 0x80000000;
pub const ECHO: ::tcflag_t = 0x00000008;
pub const OCRNL: ::tcflag_t = 0o000010;
pub const ONOCR: ::tcflag_t = 0o000020;
pub const ONLRET: ::tcflag_t = 0o000040;
pub const OFILL: ::tcflag_t = 0o000100;
pub const OFDEL: ::tcflag_t = 0o000200;
pub const CLONE_VM: ::c_int = 0x100;
pub const CLONE_FS: ::c_int = 0x200;
pub const CLONE_FILES: ::c_int = 0x400;
pub const CLONE_SIGHAND: ::c_int = 0x800;
pub const CLONE_PTRACE: ::c_int = 0x2000;
pub const CLONE_VFORK: ::c_int = 0x4000;
pub const CLONE_PARENT: ::c_int = 0x8000;
pub const CLONE_THREAD: ::c_int = 0x10000;
pub const CLONE_NEWNS: ::c_int = 0x20000;
pub const CLONE_SYSVSEM: ::c_int = 0x40000;
pub const CLONE_SETTLS: ::c_int = 0x80000;
pub const CLONE_PARENT_SETTID: ::c_int = 0x100000;
pub const CLONE_CHILD_CLEARTID: ::c_int = 0x200000;
pub const CLONE_DETACHED: ::c_int = 0x400000;
pub const CLONE_UNTRACED: ::c_int = 0x800000;
pub const CLONE_CHILD_SETTID: ::c_int = 0x01000000;
pub const CLONE_NEWUTS: ::c_int = 0x04000000;
pub const CLONE_NEWIPC: ::c_int = 0x08000000;
pub const CLONE_NEWUSER: ::c_int = 0x10000000;
pub const CLONE_NEWPID: ::c_int = 0x20000000;
pub const CLONE_NEWNET: ::c_int = 0x40000000;
pub const CLONE_IO: ::c_int = 0x80000000;
pub const CLONE_NEWCGROUP: ::c_int = 0x02000000;
pub const WNOHANG: ::c_int = 0x00000001;
pub const WUNTRACED: ::c_int = 0x00000002;
pub const WSTOPPED: ::c_int = WUNTRACED;
pub const WEXITED: ::c_int = 0x00000004;
pub const WCONTINUED: ::c_int = 0x00000008;
pub const WNOWAIT: ::c_int = 0x01000000;
// ::Options set using PTRACE_SETOPTIONS.
pub const PTRACE_O_TRACESYSGOOD: ::c_int = 0x00000001;
pub const PTRACE_O_TRACEFORK: ::c_int = 0x00000002;
pub const PTRACE_O_TRACEVFORK: ::c_int = 0x00000004;
pub const PTRACE_O_TRACECLONE: ::c_int = 0x00000008;
pub const PTRACE_O_TRACEEXEC: ::c_int = 0x00000010;
pub const PTRACE_O_TRACEVFORKDONE: ::c_int = 0x00000020;
pub const PTRACE_O_TRACEEXIT: ::c_int = 0x00000040;
pub const PTRACE_O_TRACESECCOMP: ::c_int = 0x00000080;
pub const PTRACE_O_EXITKILL: ::c_int = 0x00100000;
pub const PTRACE_O_SUSPEND_SECCOMP: ::c_int = 0x00200000;
pub const PTRACE_O_MASK: ::c_int = 0x003000ff;
// Wait extended result codes for the above trace options.
pub const PTRACE_EVENT_FORK: ::c_int = 1;
pub const PTRACE_EVENT_VFORK: ::c_int = 2;
pub const PTRACE_EVENT_CLONE: ::c_int = 3;
pub const PTRACE_EVENT_EXEC: ::c_int = 4;
pub const PTRACE_EVENT_VFORK_DONE: ::c_int = 5;
pub const PTRACE_EVENT_EXIT: ::c_int = 6;
pub const PTRACE_EVENT_SECCOMP: ::c_int = 7;
// PTRACE_EVENT_STOP was added to glibc in 2.26
// pub const PTRACE_EVENT_STOP: ::c_int = 128;
pub const __WNOTHREAD: ::c_int = 0x20000000;
pub const __WALL: ::c_int = 0x40000000;
pub const __WCLONE: ::c_int = 0x80000000;
pub const SPLICE_F_MOVE: ::c_uint = 0x01;
pub const SPLICE_F_NONBLOCK: ::c_uint = 0x02;
pub const SPLICE_F_MORE: ::c_uint = 0x04;
pub const SPLICE_F_GIFT: ::c_uint = 0x08;
pub const RTLD_LOCAL: ::c_int = 0;
pub const RTLD_LAZY: ::c_int = 1;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
pub const AT_FDCWD: ::c_int = -100;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
pub const AT_REMOVEDIR: ::c_int = 0x200;
pub const AT_EACCESS: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_NO_AUTOMOUNT: ::c_int = 0x800;
pub const AT_EMPTY_PATH: ::c_int = 0x1000;
pub const LOG_CRON: ::c_int = 9 << 3;
pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_FTP: ::c_int = 11 << 3;
pub const LOG_PERROR: ::c_int = 0x20;
pub const PIPE_BUF: usize = 4096;
pub const SI_LOAD_SHIFT: ::c_uint = 16;
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
pub const CLD_DUMPED: ::c_int = 3;
pub const CLD_TRAPPED: ::c_int = 4;
pub const CLD_STOPPED: ::c_int = 5;
pub const CLD_CONTINUED: ::c_int = 6;
pub const SIGEV_SIGNAL: ::c_int = 0;
pub const SIGEV_NONE: ::c_int = 1;
pub const SIGEV_THREAD: ::c_int = 2;
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 2;
pub const UTIME_OMIT: c_long = 1073741822;
pub const UTIME_NOW: c_long = 1073741823;
pub const POLLIN: ::c_short = 0x1;
pub const POLLPRI: ::c_short = 0x2;
pub const POLLOUT: ::c_short = 0x4;
pub const POLLERR: ::c_short = 0x8;
pub const POLLHUP: ::c_short = 0x10;
pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLRDBAND: ::c_short = 0x080;
pub const ABDAY_1: ::nl_item = 0x20000;
pub const ABDAY_2: ::nl_item = 0x20001;
pub const ABDAY_3: ::nl_item = 0x20002;
pub const ABDAY_4: ::nl_item = 0x20003;
pub const ABDAY_5: ::nl_item = 0x20004;
pub const ABDAY_6: ::nl_item = 0x20005;
pub const ABDAY_7: ::nl_item = 0x20006;
pub const DAY_1: ::nl_item = 0x20007;
pub const DAY_2: ::nl_item = 0x20008;
pub const DAY_3: ::nl_item = 0x20009;
pub const DAY_4: ::nl_item = 0x2000A;
pub const DAY_5: ::nl_item = 0x2000B;
pub const DAY_6: ::nl_item = 0x2000C;
pub const DAY_7: ::nl_item = 0x2000D;
pub const ABMON_1: ::nl_item = 0x2000E;
pub const ABMON_2: ::nl_item = 0x2000F;
pub const ABMON_3: ::nl_item = 0x20010;
pub const ABMON_4: ::nl_item = 0x20011;
pub const ABMON_5: ::nl_item = 0x20012;
pub const ABMON_6: ::nl_item = 0x20013;
pub const ABMON_7: ::nl_item = 0x20014;
pub const ABMON_8: ::nl_item = 0x20015;
pub const ABMON_9: ::nl_item = 0x20016;
pub const ABMON_10: ::nl_item = 0x20017;
pub const ABMON_11: ::nl_item = 0x20018;
pub const ABMON_12: ::nl_item = 0x20019;
pub const MON_1: ::nl_item = 0x2001A;
pub const MON_2: ::nl_item = 0x2001B;
pub const MON_3: ::nl_item = 0x2001C;
pub const MON_4: ::nl_item = 0x2001D;
pub const MON_5: ::nl_item = 0x2001E;
pub const MON_6: ::nl_item = 0x2001F;
pub const MON_7: ::nl_item = 0x20020;
pub const MON_8: ::nl_item = 0x20021;
pub const MON_9: ::nl_item = 0x20022;
pub const MON_10: ::nl_item = 0x20023;
pub const MON_11: ::nl_item = 0x20024;
pub const MON_12: ::nl_item = 0x20025;
pub const AM_STR: ::nl_item = 0x20026;
pub const PM_STR: ::nl_item = 0x20027;
pub const D_T_FMT: ::nl_item = 0x20028;
pub const D_FMT: ::nl_item = 0x20029;
pub const T_FMT: ::nl_item = 0x2002A;
pub const T_FMT_AMPM: ::nl_item = 0x2002B;
pub const ERA: ::nl_item = 0x2002C;
pub const ERA_D_FMT: ::nl_item = 0x2002E;
pub const ALT_DIGITS: ::nl_item = 0x2002F;
pub const ERA_D_T_FMT: ::nl_item = 0x20030;
pub const ERA_T_FMT: ::nl_item = 0x20031;
pub const CODESET: ::nl_item = 14;
pub const CRNCYSTR: ::nl_item = 0x4000F;
pub const RUSAGE_THREAD: ::c_int = 1;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const RADIXCHAR: ::nl_item = 0x10000;
pub const THOUSEP: ::nl_item = 0x10001;
pub const YESEXPR: ::nl_item = 0x50000;
pub const NOEXPR: ::nl_item = 0x50001;
pub const YESSTR: ::nl_item = 0x50002;
pub const NOSTR: ::nl_item = 0x50003;
pub const FILENAME_MAX: ::c_uint = 4096;
pub const L_tmpnam: ::c_uint = 20;
pub const _PC_LINK_MAX: ::c_int = 0;
pub const _PC_MAX_CANON: ::c_int = 1;
pub const _PC_MAX_INPUT: ::c_int = 2;
pub const _PC_NAME_MAX: ::c_int = 3;
pub const _PC_PATH_MAX: ::c_int = 4;
pub const _PC_PIPE_BUF: ::c_int = 5;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 6;
pub const _PC_NO_TRUNC: ::c_int = 7;
pub const _PC_VDISABLE: ::c_int = 8;
pub const _PC_SYNC_IO: ::c_int = 9;
pub const _PC_ASYNC_IO: ::c_int = 10;
pub const _PC_PRIO_IO: ::c_int = 11;
pub const _PC_SOCK_MAXBUF: ::c_int = 12;
pub const _PC_FILESIZEBITS: ::c_int = 13;
pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
pub const _PC_SYMLINK_MAX: ::c_int = 19;
pub const _PC_2_SYMLINKS: ::c_int = 20;
pub const _SC_ARG_MAX: ::c_int = 0;
pub const _SC_CHILD_MAX: ::c_int = 1;
pub const _SC_CLK_TCK: ::c_int = 2;
pub const _SC_NGROUPS_MAX: ::c_int = 3;
pub const _SC_OPEN_MAX: ::c_int = 4;
pub const _SC_STREAM_MAX: ::c_int = 5;
pub const _SC_TZNAME_MAX: ::c_int = 6;
pub const _SC_JOB_CONTROL: ::c_int = 7;
pub const _SC_SAVED_IDS: ::c_int = 8;
pub const _SC_REALTIME_SIGNALS: ::c_int = 9;
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 10;
pub const _SC_TIMERS: ::c_int = 11;
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 12;
pub const _SC_PRIORITIZED_IO: ::c_int = 13;
pub const _SC_SYNCHRONIZED_IO: ::c_int = 14;
pub const _SC_FSYNC: ::c_int = 15;
pub const _SC_MAPPED_FILES: ::c_int = 16;
pub const _SC_MEMLOCK: ::c_int = 17;
pub const _SC_MEMLOCK_RANGE: ::c_int = 18;
pub const _SC_MEMORY_PROTECTION: ::c_int = 19;
pub const _SC_MESSAGE_PASSING: ::c_int = 20;
pub const _SC_SEMAPHORES: ::c_int = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 22;
pub const _SC_AIO_LISTIO_MAX: ::c_int = 23;
pub const _SC_AIO_MAX: ::c_int = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 25;
pub const _SC_DELAYTIMER_MAX: ::c_int = 26;
pub const _SC_MQ_OPEN_MAX: ::c_int = 27;
pub const _SC_MQ_PRIO_MAX: ::c_int = 28;
pub const _SC_VERSION: ::c_int = 29;
pub const _SC_PAGESIZE: ::c_int = 30;
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_RTSIG_MAX: ::c_int = 31;
pub const _SC_SEM_NSEMS_MAX: ::c_int = 32;
pub const _SC_SEM_VALUE_MAX: ::c_int = 33;
pub const _SC_SIGQUEUE_MAX: ::c_int = 34;
pub const _SC_TIMER_MAX: ::c_int = 35;
pub const _SC_BC_BASE_MAX: ::c_int = 36;
pub const _SC_BC_DIM_MAX: ::c_int = 37;
pub const _SC_BC_SCALE_MAX: ::c_int = 38;
pub const _SC_BC_STRING_MAX: ::c_int = 39;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 40;
pub const _SC_EXPR_NEST_MAX: ::c_int = 42;
pub const _SC_LINE_MAX: ::c_int = 43;
pub const _SC_RE_DUP_MAX: ::c_int = 44;
pub const _SC_2_VERSION: ::c_int = 46;
pub const _SC_2_C_BIND: ::c_int = 47;
pub const _SC_2_C_DEV: ::c_int = 48;
pub const _SC_2_FORT_DEV: ::c_int = 49;
pub const _SC_2_FORT_RUN: ::c_int = 50;
pub const _SC_2_SW_DEV: ::c_int = 51;
pub const _SC_2_LOCALEDEF: ::c_int = 52;
pub const _SC_UIO_MAXIOV: ::c_int = 60;
pub const _SC_IOV_MAX: ::c_int = 60;
pub const _SC_THREADS: ::c_int = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 68;
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 69;
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 70;
pub const _SC_LOGIN_NAME_MAX: ::c_int = 71;
pub const _SC_TTY_NAME_MAX: ::c_int = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 73;
pub const _SC_THREAD_KEYS_MAX: ::c_int = 74;
pub const _SC_THREAD_STACK_MIN: ::c_int = 75;
pub const _SC_THREAD_THREADS_MAX: ::c_int = 76;
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 79;
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 80;
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 81;
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 82;
pub const _SC_NPROCESSORS_CONF: ::c_int = 83;
pub const _SC_NPROCESSORS_ONLN: ::c_int = 84;
pub const _SC_PHYS_PAGES: ::c_int = 85;
pub const _SC_AVPHYS_PAGES: ::c_int = 86;
pub const _SC_ATEXIT_MAX: ::c_int = 87;
pub const _SC_PASS_MAX: ::c_int = 88;
pub const _SC_XOPEN_VERSION: ::c_int = 89;
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 90;
pub const _SC_XOPEN_UNIX: ::c_int = 91;
pub const _SC_XOPEN_CRYPT: ::c_int = 92;
pub const _SC_XOPEN_ENH_I18N: ::c_int = 93;
pub const _SC_XOPEN_SHM: ::c_int = 94;
pub const _SC_2_CHAR_TERM: ::c_int = 95;
pub const _SC_2_UPE: ::c_int = 97;
pub const _SC_XOPEN_XPG2: ::c_int = 98;
pub const _SC_XOPEN_XPG3: ::c_int = 99;
pub const _SC_XOPEN_XPG4: ::c_int = 100;
pub const _SC_NZERO: ::c_int = 109;
pub const _SC_XBS5_ILP32_OFF32: ::c_int = 125;
pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 126;
pub const _SC_XBS5_LP64_OFF64: ::c_int = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 128;
pub const _SC_XOPEN_LEGACY: ::c_int = 129;
pub const _SC_XOPEN_REALTIME: ::c_int = 130;
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 131;
pub const _SC_ADVISORY_INFO: ::c_int = 132;
pub const _SC_BARRIERS: ::c_int = 133;
pub const _SC_CLOCK_SELECTION: ::c_int = 137;
pub const _SC_CPUTIME: ::c_int = 138;
pub const _SC_THREAD_CPUTIME: ::c_int = 139;
pub const _SC_MONOTONIC_CLOCK: ::c_int = 149;
pub const _SC_READER_WRITER_LOCKS: ::c_int = 153;
pub const _SC_SPIN_LOCKS: ::c_int = 154;
pub const _SC_REGEXP: ::c_int = 155;
pub const _SC_SHELL: ::c_int = 157;
pub const _SC_SPAWN: ::c_int = 159;
pub const _SC_SPORADIC_SERVER: ::c_int = 160;
pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 161;
pub const _SC_TIMEOUTS: ::c_int = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 165;
pub const _SC_2_PBS: ::c_int = 168;
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 169;
pub const _SC_2_PBS_LOCATE: ::c_int = 170;
pub const _SC_2_PBS_MESSAGE: ::c_int = 171;
pub const _SC_2_PBS_TRACK: ::c_int = 172;
pub const _SC_SYMLOOP_MAX: ::c_int = 173;
pub const _SC_STREAMS: ::c_int = 174;
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 175;
pub const _SC_V6_ILP32_OFF32: ::c_int = 176;
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 177;
pub const _SC_V6_LP64_OFF64: ::c_int = 178;
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 179;
pub const _SC_HOST_NAME_MAX: ::c_int = 180;
pub const _SC_TRACE: ::c_int = 181;
pub const _SC_TRACE_EVENT_FILTER: ::c_int = 182;
pub const _SC_TRACE_INHERIT: ::c_int = 183;
pub const _SC_TRACE_LOG: ::c_int = 184;
pub const _SC_IPV6: ::c_int = 235;
pub const _SC_RAW_SOCKETS: ::c_int = 236;
pub const _SC_V7_ILP32_OFF32: ::c_int = 237;
pub const _SC_V7_ILP32_OFFBIG: ::c_int = 238;
pub const _SC_V7_LP64_OFF64: ::c_int = 239;
pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 240;
pub const _SC_SS_REPL_MAX: ::c_int = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 242;
pub const _SC_TRACE_NAME_MAX: ::c_int = 243;
pub const _SC_TRACE_SYS_MAX: ::c_int = 244;
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 245;
pub const _SC_XOPEN_STREAMS: ::c_int = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 248;
pub const RLIM_SAVED_MAX: ::rlim_t = RLIM_INFINITY;
pub const RLIM_SAVED_CUR: ::rlim_t = RLIM_INFINITY;
pub const GLOB_ERR: ::c_int = 1 << 0;
pub const GLOB_MARK: ::c_int = 1 << 1;
pub const GLOB_NOSORT: ::c_int = 1 << 2;
pub const GLOB_DOOFFS: ::c_int = 1 << 3;
pub const GLOB_NOCHECK: ::c_int = 1 << 4;
pub const GLOB_APPEND: ::c_int = 1 << 5;
pub const GLOB_NOESCAPE: ::c_int = 1 << 6;
pub const GLOB_NOSPACE: ::c_int = 1;
pub const GLOB_ABORTED: ::c_int = 2;
pub const GLOB_NOMATCH: ::c_int = 3;
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const IFF_LOWER_UP: ::c_int = 0x10000;
pub const IFF_DORMANT: ::c_int = 0x20000;
pub const IFF_ECHO: ::c_int = 0x40000;
pub const ST_RDONLY: ::c_ulong = 1;
pub const ST_NOSUID: ::c_ulong = 2;
pub const ST_NODEV: ::c_ulong = 4;
pub const ST_NOEXEC: ::c_ulong = 8;
pub const ST_SYNCHRONOUS: ::c_ulong = 16;
pub const ST_MANDLOCK: ::c_ulong = 64;
pub const ST_WRITE: ::c_ulong = 128;
pub const ST_APPEND: ::c_ulong = 256;
pub const ST_IMMUTABLE: ::c_ulong = 512;
pub const ST_NOATIME: ::c_ulong = 1024;
pub const ST_NODIRATIME: ::c_ulong = 2048;
pub const RTLD_NEXT: *mut ::c_void = -1i64 as *mut ::c_void;
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;
pub const RTLD_NODELETE: ::c_int = 0x1000;
pub const RTLD_NOW: ::c_int = 0x2;
pub const TCP_MD5SIG: ::c_int = 14;
align_const! {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
size: [0; __SIZEOF_PTHREAD_COND_T],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
size: [0; __SIZEOF_PTHREAD_RWLOCK_T],
};
}
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const RENAME_NOREPLACE: ::c_int = 1;
pub const RENAME_EXCHANGE: ::c_int = 2;
pub const RENAME_WHITEOUT: ::c_int = 4;
pub const SCHED_OTHER: ::c_int = 0;
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_RR: ::c_int = 2;
pub const SCHED_BATCH: ::c_int = 3;
pub const SCHED_IDLE: ::c_int = 5;
// netinet/in.h
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// Hop-by-hop option header
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
// IPPROTO_UDP defined in src/unix/mod.rs
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// DCCP
pub const IPPROTO_DCCP: ::c_int = 33;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
pub const IPPROTO_MTP: ::c_int = 92;
pub const IPPROTO_BEETPH: ::c_int = 94;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// Protocol indep. multicast
pub const IPPROTO_PIM: ::c_int = 103;
/// IP Payload Comp. Protocol
pub const IPPROTO_COMP: ::c_int = 108;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
pub const IPPROTO_MH: ::c_int = 135;
pub const IPPROTO_UDPLITE: ::c_int = 136;
pub const IPPROTO_MPLS: ::c_int = 137;
/// raw IP packet
pub const IPPROTO_RAW: ::c_int = 255;
pub const IPPROTO_MAX: ::c_int = 256;
pub const AF_IB: ::c_int = 27;
pub const AF_MPLS: ::c_int = 28;
pub const AF_NFC: ::c_int = 39;
pub const AF_VSOCK: ::c_int = 40;
pub const PF_IB: ::c_int = AF_IB;
pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
// System V IPC
pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_CREAT: ::c_int = 0o1000;
pub const IPC_EXCL: ::c_int = 0o2000;
pub const IPC_NOWAIT: ::c_int = 0o4000;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_INFO: ::c_int = 3;
pub const MSG_STAT: ::c_int = 11;
pub const MSG_INFO: ::c_int = 12;
pub const MSG_NOERROR: ::c_int = 0o10000;
pub const MSG_EXCEPT: ::c_int = 0o20000;
pub const MSG_COPY: ::c_int = 0o40000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
pub const SHM_RDONLY: ::c_int = 0o10000;
pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_REMAP: ::c_int = 0o40000;
pub const SHM_EXEC: ::c_int = 0o100000;
pub const SHM_LOCK: ::c_int = 11;
pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_HUGETLB: ::c_int = 0o4000;
pub const SHM_NORESERVE: ::c_int = 0o10000;
pub const EPOLLRDHUP: ::c_int = 0x2000;
pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const QFMT_VFS_OLD: ::c_int = 1;
pub const QFMT_VFS_V0: ::c_int = 2;
pub const QFMT_VFS_V1: ::c_int = 4;
pub const EFD_SEMAPHORE: ::c_int = 0x1;
pub const LOG_NFACILITIES: ::c_int = 24;
pub const SEM_FAILED: *mut ::sem_t = 0 as *mut sem_t;
pub const RB_AUTOBOOT: ::c_int = 0x01234567u32 as i32;
pub const RB_HALT_SYSTEM: ::c_int = 0xcdef0123u32 as i32;
pub const RB_ENABLE_CAD: ::c_int = 0x89abcdefu32 as i32;
pub const RB_DISABLE_CAD: ::c_int = 0x00000000u32 as i32;
pub const RB_POWER_OFF: ::c_int = 0x4321fedcu32 as i32;
pub const RB_SW_SUSPEND: ::c_int = 0xd000fce2u32 as i32;
pub const RB_KEXEC: ::c_int = 0x45584543u32 as i32;
pub const AI_PASSIVE: ::c_int = 0x0001;
pub const AI_CANONNAME: ::c_int = 0x0002;
pub const AI_NUMERICHOST: ::c_int = 0x0004;
pub const AI_V4MAPPED: ::c_int = 0x0008;
pub const AI_ALL: ::c_int = 0x0010;
pub const AI_ADDRCONFIG: ::c_int = 0x0020;
pub const AI_NUMERICSERV: ::c_int = 0x0400;
pub const EAI_BADFLAGS: ::c_int = -1;
pub const EAI_NONAME: ::c_int = -2;
pub const EAI_AGAIN: ::c_int = -3;
pub const EAI_FAIL: ::c_int = -4;
pub const EAI_FAMILY: ::c_int = -6;
pub const EAI_SOCKTYPE: ::c_int = -7;
pub const EAI_SERVICE: ::c_int = -8;
pub const EAI_MEMORY: ::c_int = -10;
pub const EAI_OVERFLOW: ::c_int = -12;
pub const NI_NUMERICHOST: ::c_int = 1;
pub const NI_NUMERICSERV: ::c_int = 2;
pub const NI_NOFQDN: ::c_int = 4;
pub const NI_NAMEREQD: ::c_int = 8;
pub const NI_DGRAM: ::c_int = 16;
pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
pub const EAI_SYSTEM: ::c_int = -11;
pub const AIO_CANCELED: ::c_int = 0;
pub const AIO_NOTCANCELED: ::c_int = 1;
pub const AIO_ALLDONE: ::c_int = 2;
pub const LIO_READ: ::c_int = 0;
pub const LIO_WRITE: ::c_int = 1;
pub const LIO_NOP: ::c_int = 2;
pub const LIO_WAIT: ::c_int = 0;
pub const LIO_NOWAIT: ::c_int = 1;
pub const MREMAP_MAYMOVE: ::c_int = 1;
pub const MREMAP_FIXED: ::c_int = 2;
pub const PR_SET_PDEATHSIG: ::c_int = 1;
pub const PR_GET_PDEATHSIG: ::c_int = 2;
pub const PR_GET_DUMPABLE: ::c_int = 3;
pub const PR_SET_DUMPABLE: ::c_int = 4;
pub const PR_GET_UNALIGN: ::c_int = 5;
pub const PR_SET_UNALIGN: ::c_int = 6;
pub const PR_UNALIGN_NOPRINT: ::c_int = 1;
pub const PR_UNALIGN_SIGBUS: ::c_int = 2;
pub const PR_GET_KEEPCAPS: ::c_int = 7;
pub const PR_SET_KEEPCAPS: ::c_int = 8;
pub const PR_GET_FPEMU: ::c_int = 9;
pub const PR_SET_FPEMU: ::c_int = 10;
pub const PR_FPEMU_NOPRINT: ::c_int = 1;
pub const PR_FPEMU_SIGFPE: ::c_int = 2;
pub const PR_GET_FPEXC: ::c_int = 11;
pub const PR_SET_FPEXC: ::c_int = 12;
pub const PR_FP_EXC_SW_ENABLE: ::c_int = 0x80;
pub const PR_FP_EXC_DIV: ::c_int = 0x010000;
pub const PR_FP_EXC_OVF: ::c_int = 0x020000;
pub const PR_FP_EXC_UND: ::c_int = 0x040000;
pub const PR_FP_EXC_RES: ::c_int = 0x080000;
pub const PR_FP_EXC_INV: ::c_int = 0x100000;
pub const PR_FP_EXC_DISABLED: ::c_int = 0;
pub const PR_FP_EXC_NONRECOV: ::c_int = 1;
pub const PR_FP_EXC_ASYNC: ::c_int = 2;
pub const PR_FP_EXC_PRECISE: ::c_int = 3;
pub const PR_GET_TIMING: ::c_int = 13;
pub const PR_SET_TIMING: ::c_int = 14;
pub const PR_TIMING_STATISTICAL: ::c_int = 0;
pub const PR_TIMING_TIMESTAMP: ::c_int = 1;
pub const PR_SET_NAME: ::c_int = 15;
pub const PR_GET_NAME: ::c_int = 16;
pub const PR_GET_ENDIAN: ::c_int = 19;
pub const PR_SET_ENDIAN: ::c_int = 20;
pub const PR_ENDIAN_BIG: ::c_int = 0;
pub const PR_ENDIAN_LITTLE: ::c_int = 1;
pub const PR_ENDIAN_PPC_LITTLE: ::c_int = 2;
pub const PR_GET_SECCOMP: ::c_int = 21;
pub const PR_SET_SECCOMP: ::c_int = 22;
pub const PR_CAPBSET_READ: ::c_int = 23;
pub const PR_CAPBSET_DROP: ::c_int = 24;
pub const PR_GET_TSC: ::c_int = 25;
pub const PR_SET_TSC: ::c_int = 26;
pub const PR_TSC_ENABLE: ::c_int = 1;
pub const PR_TSC_SIGSEGV: ::c_int = 2;
pub const PR_GET_SECUREBITS: ::c_int = 27;
pub const PR_SET_SECUREBITS: ::c_int = 28;
pub const PR_SET_TIMERSLACK: ::c_int = 29;
pub const PR_GET_TIMERSLACK: ::c_int = 30;
pub const PR_TASK_PERF_EVENTS_DISABLE: ::c_int = 31;
pub const PR_TASK_PERF_EVENTS_ENABLE: ::c_int = 32;
pub const PR_MCE_KILL: ::c_int = 33;
pub const PR_MCE_KILL_CLEAR: ::c_int = 0;
pub const PR_MCE_KILL_SET: ::c_int = 1;
pub const PR_MCE_KILL_LATE: ::c_int = 0;
pub const PR_MCE_KILL_EARLY: ::c_int = 1;
pub const PR_MCE_KILL_DEFAULT: ::c_int = 2;
pub const PR_MCE_KILL_GET: ::c_int = 34;
pub const PR_SET_MM: ::c_int = 35;
pub const PR_SET_MM_START_CODE: ::c_int = 1;
pub const PR_SET_MM_END_CODE: ::c_int = 2;
pub const PR_SET_MM_START_DATA: ::c_int = 3;
pub const PR_SET_MM_END_DATA: ::c_int = 4;
pub const PR_SET_MM_START_STACK: ::c_int = 5;
pub const PR_SET_MM_START_BRK: ::c_int = 6;
pub const PR_SET_MM_BRK: ::c_int = 7;
pub const PR_SET_MM_ARG_START: ::c_int = 8;
pub const PR_SET_MM_ARG_END: ::c_int = 9;
pub const PR_SET_MM_ENV_START: ::c_int = 10;
pub const PR_SET_MM_ENV_END: ::c_int = 11;
pub const PR_SET_MM_AUXV: ::c_int = 12;
pub const PR_SET_MM_EXE_FILE: ::c_int = 13;
pub const PR_SET_MM_MAP: ::c_int = 14;
pub const PR_SET_MM_MAP_SIZE: ::c_int = 15;
pub const PR_SET_PTRACER: ::c_int = 0x59616d61;
pub const PR_SET_PTRACER_ANY: ::c_ulong = 0xffffffffffffffff;
pub const PR_SET_CHILD_SUBREAPER: ::c_int = 36;
pub const PR_GET_CHILD_SUBREAPER: ::c_int = 37;
pub const PR_SET_NO_NEW_PRIVS: ::c_int = 38;
pub const PR_GET_NO_NEW_PRIVS: ::c_int = 39;
pub const PR_GET_TID_ADDRESS: ::c_int = 40;
pub const PR_SET_THP_DISABLE: ::c_int = 41;
pub const PR_GET_THP_DISABLE: ::c_int = 42;
pub const PR_MPX_ENABLE_MANAGEMENT: ::c_int = 43;
pub const PR_MPX_DISABLE_MANAGEMENT: ::c_int = 44;
pub const PR_SET_FP_MODE: ::c_int = 45;
pub const PR_GET_FP_MODE: ::c_int = 46;
pub const PR_FP_MODE_FR: ::c_int = 1 << 0;
pub const PR_FP_MODE_FRE: ::c_int = 1 << 1;
pub const PR_CAP_AMBIENT: ::c_int = 47;
pub const PR_CAP_AMBIENT_IS_SET: ::c_int = 1;
pub const PR_CAP_AMBIENT_RAISE: ::c_int = 2;
pub const PR_CAP_AMBIENT_LOWER: ::c_int = 3;
pub const PR_CAP_AMBIENT_CLEAR_ALL: ::c_int = 4;
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
pub const TFD_NONBLOCK: ::c_int = O_NONBLOCK;
pub const TFD_TIMER_ABSTIME: ::c_int = 1;
pub const XATTR_CREATE: ::c_int = 0x1;
pub const XATTR_REPLACE: ::c_int = 0x2;
pub const _POSIX_VDISABLE: ::cc_t = 0;
pub const FALLOC_FL_KEEP_SIZE: ::c_int = 0x01;
pub const FALLOC_FL_PUNCH_HOLE: ::c_int = 0x02;
pub const FALLOC_FL_COLLAPSE_RANGE: ::c_int = 0x08;
pub const FALLOC_FL_ZERO_RANGE: ::c_int = 0x10;
pub const FALLOC_FL_INSERT_RANGE: ::c_int = 0x20;
pub const FALLOC_FL_UNSHARE_RANGE: ::c_int = 0x40;
// On Linux, libc doesn't define this constant, libattr does instead.
// We still define it for Linux as it's defined by libc on other platforms,
// and it's mentioned in the man pages for getxattr and setxattr.
pub const ENOATTR: ::c_int = ::ENODATA;
pub const SO_ORIGINAL_DST: ::c_int = 80;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CMSPAR: ::tcflag_t = 0o10000000000;
pub const MFD_CLOEXEC: ::c_uint = 0x0001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x0002;
// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has
// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32
// so we can use that type here to avoid having to cast.
pub const PT_NULL: u32 = 0;
pub const PT_LOAD: u32 = 1;
pub const PT_DYNAMIC: u32 = 2;
pub const PT_INTERP: u32 = 3;
pub const PT_NOTE: u32 = 4;
pub const PT_SHLIB: u32 = 5;
pub const PT_PHDR: u32 = 6;
pub const PT_TLS: u32 = 7;
pub const PT_NUM: u32 = 8;
pub const PT_LOOS: u32 = 0x60000000;
pub const PT_GNU_EH_FRAME: u32 = 0x6474e550;
pub const PT_GNU_STACK: u32 = 0x6474e551;
pub const PT_GNU_RELRO: u32 = 0x6474e552;
// Ethernet protocol IDs.
pub const ETH_P_LOOP: ::c_int = 0x0060;
pub const ETH_P_PUP: ::c_int = 0x0200;
pub const ETH_P_PUPAT: ::c_int = 0x0201;
pub const ETH_P_IP: ::c_int = 0x0800;
pub const ETH_P_X25: ::c_int = 0x0805;
pub const ETH_P_ARP: ::c_int = 0x0806;
pub const ETH_P_BPQ: ::c_int = 0x08FF;
pub const ETH_P_IEEEPUP: ::c_int = 0x0a00;
pub const ETH_P_IEEEPUPAT: ::c_int = 0x0a01;
pub const ETH_P_BATMAN: ::c_int = 0x4305;
pub const ETH_P_DEC: ::c_int = 0x6000;
pub const ETH_P_DNA_DL: ::c_int = 0x6001;
pub const ETH_P_DNA_RC: ::c_int = 0x6002;
pub const ETH_P_DNA_RT: ::c_int = 0x6003;
pub const ETH_P_LAT: ::c_int = 0x6004;
pub const ETH_P_DIAG: ::c_int = 0x6005;
pub const ETH_P_CUST: ::c_int = 0x6006;
pub const ETH_P_SCA: ::c_int = 0x6007;
pub const ETH_P_TEB: ::c_int = 0x6558;
pub const ETH_P_RARP: ::c_int = 0x8035;
pub const ETH_P_ATALK: ::c_int = 0x809B;
pub const ETH_P_AARP: ::c_int = 0x80F3;
pub const ETH_P_8021Q: ::c_int = 0x8100;
pub const ETH_P_IPX: ::c_int = 0x8137;
pub const ETH_P_IPV6: ::c_int = 0x86DD;
pub const ETH_P_PAUSE: ::c_int = 0x8808;
pub const ETH_P_SLOW: ::c_int = 0x8809;
pub const ETH_P_WCCP: ::c_int = 0x883E;
pub const ETH_P_MPLS_UC: ::c_int = 0x8847;
pub const ETH_P_MPLS_MC: ::c_int = 0x8848;
pub const ETH_P_ATMMPOA: ::c_int = 0x884c;
pub const ETH_P_PPP_DISC: ::c_int = 0x8863;
pub const ETH_P_PPP_SES: ::c_int = 0x8864;
pub const ETH_P_LINK_CTL: ::c_int = 0x886c;
pub const ETH_P_ATMFATE: ::c_int = 0x8884;
pub const ETH_P_PAE: ::c_int = 0x888E;
pub const ETH_P_AOE: ::c_int = 0x88A2;
pub const ETH_P_8021AD: ::c_int = 0x88A8;
pub const ETH_P_802_EX1: ::c_int = 0x88B5;
pub const ETH_P_TIPC: ::c_int = 0x88CA;
pub const ETH_P_8021AH: ::c_int = 0x88E7;
pub const ETH_P_MVRP: ::c_int = 0x88F5;
pub const ETH_P_1588: ::c_int = 0x88F7;
pub const ETH_P_PRP: ::c_int = 0x88FB;
pub const ETH_P_FCOE: ::c_int = 0x8906;
pub const ETH_P_TDLS: ::c_int = 0x890D;
pub const ETH_P_FIP: ::c_int = 0x8914;
pub const ETH_P_80221: ::c_int = 0x8917;
pub const ETH_P_LOOPBACK: ::c_int = 0x9000;
pub const ETH_P_QINQ1: ::c_int = 0x9100;
pub const ETH_P_QINQ2: ::c_int = 0x9200;
pub const ETH_P_QINQ3: ::c_int = 0x9300;
pub const ETH_P_EDSA: ::c_int = 0xDADA;
pub const ETH_P_AF_IUCV: ::c_int = 0xFBFB;
pub const ETH_P_802_3_MIN: ::c_int = 0x0600;
pub const ETH_P_802_3: ::c_int = 0x0001;
pub const ETH_P_AX25: ::c_int = 0x0002;
pub const ETH_P_ALL: ::c_int = 0x0003;
pub const ETH_P_802_2: ::c_int = 0x0004;
pub const ETH_P_SNAP: ::c_int = 0x0005;
pub const ETH_P_DDCMP: ::c_int = 0x0006;
pub const ETH_P_WAN_PPP: ::c_int = 0x0007;
pub const ETH_P_PPP_MP: ::c_int = 0x0008;
pub const ETH_P_LOCALTALK: ::c_int = 0x0009;
pub const ETH_P_CAN: ::c_int = 0x000C;
pub const ETH_P_CANFD: ::c_int = 0x000D;
pub const ETH_P_PPPTALK: ::c_int = 0x0010;
pub const ETH_P_TR_802_2: ::c_int = 0x0011;
pub const ETH_P_MOBITEX: ::c_int = 0x0015;
pub const ETH_P_CONTROL: ::c_int = 0x0016;
pub const ETH_P_IRDA: ::c_int = 0x0017;
pub const ETH_P_ECONET: ::c_int = 0x0018;
pub const ETH_P_HDLC: ::c_int = 0x0019;
pub const ETH_P_ARCNET: ::c_int = 0x001A;
pub const ETH_P_DSA: ::c_int = 0x001B;
pub const ETH_P_TRAILER: ::c_int = 0x001C;
pub const ETH_P_PHONET: ::c_int = 0x00F5;
pub const ETH_P_IEEE802154: ::c_int = 0x00F6;
pub const ETH_P_CAIF: ::c_int = 0x00F7;
pub const SFD_CLOEXEC: ::c_int = 0x080000;
pub const NCCS: usize = 32;
pub const O_TRUNC: ::c_int = 0x00040000;
pub const O_NOATIME: ::c_int = 0x00002000;
pub const O_CLOEXEC: ::c_int = 0x00000100;
pub const O_TMPFILE: ::c_int = 0x00004000;
pub const EBFONT: ::c_int = 59;
pub const ENOSTR: ::c_int = 60;
pub const ENODATA: ::c_int = 61;
pub const ETIME: ::c_int = 62;
pub const ENOSR: ::c_int = 63;
pub const ENONET: ::c_int = 64;
pub const ENOPKG: ::c_int = 65;
pub const EREMOTE: ::c_int = 66;
pub const ENOLINK: ::c_int = 67;
pub const EADV: ::c_int = 68;
pub const ESRMNT: ::c_int = 69;
pub const ECOMM: ::c_int = 70;
pub const EPROTO: ::c_int = 71;
pub const EDOTDOT: ::c_int = 73;
pub const SA_NODEFER: ::c_int = 0x40000000;
pub const SA_RESETHAND: ::c_int = 0x80000000;
pub const SA_RESTART: ::c_int = 0x10000000;
pub const SA_NOCLDSTOP: ::c_int = 0x00000001;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
pub const EFD_CLOEXEC: ::c_int = 0x80000;
pub const BUFSIZ: ::c_uint = 1024;
pub const TMP_MAX: ::c_uint = 10000;
pub const FOPEN_MAX: ::c_uint = 1000;
pub const O_PATH: ::c_int = 0x00400000;
pub const O_EXEC: ::c_int = O_PATH;
pub const O_SEARCH: ::c_int = O_PATH;
pub const O_ACCMODE: ::c_int = 03 | O_SEARCH;
pub const O_NDELAY: ::c_int = O_NONBLOCK;
pub const NI_MAXHOST: ::socklen_t = 255;
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const RLIM_INFINITY: ::rlim_t = !0;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const SOCK_DCCP: ::c_int = 6;
pub const SOCK_PACKET: ::c_int = 10;
pub const TCP_COOKIE_TRANSACTIONS: ::c_int = 15;
pub const TCP_THIN_LINEAR_TIMEOUTS: ::c_int = 16;
pub const TCP_THIN_DUPACK: ::c_int = 17;
pub const TCP_USER_TIMEOUT: ::c_int = 18;
pub const TCP_REPAIR: ::c_int = 19;
pub const TCP_REPAIR_QUEUE: ::c_int = 20;
pub const TCP_QUEUE_SEQ: ::c_int = 21;
pub const TCP_REPAIR_OPTIONS: ::c_int = 22;
pub const TCP_FASTOPEN: ::c_int = 23;
pub const TCP_TIMESTAMP: ::c_int = 24;
pub const SIGUNUSED: ::c_int = ::SIGSYS;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8;
pub const CPU_SETSIZE: ::c_int = 128;
pub const PTRACE_TRACEME: ::c_int = 0;
pub const PTRACE_PEEKTEXT: ::c_int = 1;
pub const PTRACE_PEEKDATA: ::c_int = 2;
pub const PTRACE_PEEKUSER: ::c_int = 3;
pub const PTRACE_POKETEXT: ::c_int = 4;
pub const PTRACE_POKEDATA: ::c_int = 5;
pub const PTRACE_POKEUSER: ::c_int = 6;
pub const PTRACE_CONT: ::c_int = 7;
pub const PTRACE_KILL: ::c_int = 8;
pub const PTRACE_SINGLESTEP: ::c_int = 9;
pub const PTRACE_GETREGS: ::c_int = 12;
pub const PTRACE_SETREGS: ::c_int = 13;
pub const PTRACE_GETFPREGS: ::c_int = 14;
pub const PTRACE_SETFPREGS: ::c_int = 15;
pub const PTRACE_ATTACH: ::c_int = 16;
pub const PTRACE_DETACH: ::c_int = 17;
pub const PTRACE_GETFPXREGS: ::c_int = 18;
pub const PTRACE_SETFPXREGS: ::c_int = 19;
pub const PTRACE_SYSCALL: ::c_int = 24;
pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
pub const PTRACE_GETREGSET: ::c_int = 0x4204;
pub const PTRACE_SETREGSET: ::c_int = 0x4205;
pub const PTRACE_SEIZE: ::c_int = 0x4206;
pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
pub const PTRACE_LISTEN: ::c_int = 0x4208;
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
pub const TIOCINQ: ::c_int = ::FIONREAD;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const RTLD_NOLOAD: ::c_int = 0x4;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const CBAUD: ::tcflag_t = 0o0010017;
pub const TAB1: ::c_int = 0x00000800;
pub const TAB2: ::c_int = 0x00001000;
pub const TAB3: ::c_int = 0x00001800;
pub const CR1: ::c_int = 0x00000200;
pub const CR2: ::c_int = 0x00000400;
pub const CR3: ::c_int = 0x00000600;
pub const FF1: ::c_int = 0x00008000;
pub const BS1: ::c_int = 0x00002000;
pub const VT1: ::c_int = 0x00004000;
pub const VWERASE: usize = 14;
pub const VREPRINT: usize = 12;
pub const VSUSP: usize = 10;
pub const VSTART: usize = 8;
pub const VSTOP: usize = 9;
pub const VDISCARD: usize = 13;
pub const VTIME: usize = 5;
pub const IXON: ::tcflag_t = 0x00000400;
pub const IXOFF: ::tcflag_t = 0x00001000;
pub const ONLCR: ::tcflag_t = 0x4;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const ECHOKE: ::tcflag_t = 0x00000800;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOPRT: ::tcflag_t = 0x00000400;
pub const ECHOCTL: ::tcflag_t = 0x00000200;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const PENDIN: ::tcflag_t = 0x00004000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const CIBAUD: ::tcflag_t = 0o02003600000;
pub const CBAUDEX: ::tcflag_t = 0o010000;
pub const VSWTC: usize = 7;
pub const OLCUC: ::tcflag_t = 0o000002;
pub const NLDLY: ::tcflag_t = 0o000400;
pub const CRDLY: ::tcflag_t = 0o003000;
pub const TABDLY: ::tcflag_t = 0o014000;
pub const BSDLY: ::tcflag_t = 0o020000;
pub const FFDLY: ::tcflag_t = 0o100000;
pub const VTDLY: ::tcflag_t = 0o040000;
pub const XTABS: ::tcflag_t = 0o014000;
pub const B0: ::speed_t = 0o000000;
pub const B50: ::speed_t = 0o000001;
pub const B75: ::speed_t = 0o000002;
pub const B110: ::speed_t = 0o000003;
pub const B134: ::speed_t = 0o000004;
pub const B150: ::speed_t = 0o000005;
pub const B200: ::speed_t = 0o000006;
pub const B300: ::speed_t = 0o000007;
pub const B600: ::speed_t = 0o000010;
pub const B1200: ::speed_t = 0o000011;
pub const B1800: ::speed_t = 0o000012;
pub const B2400: ::speed_t = 0o000013;
pub const B4800: ::speed_t = 0o000014;
pub const B9600: ::speed_t = 0o000015;
pub const B19200: ::speed_t = 0o000016;
pub const B38400: ::speed_t = 0o000017;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const B57600: ::speed_t = 0o010001;
pub const B115200: ::speed_t = 0o010002;
pub const B230400: ::speed_t = 0o010003;
pub const B460800: ::speed_t = 0o010004;
pub const B500000: ::speed_t = 0o010005;
pub const B576000: ::speed_t = 0o010006;
pub const B921600: ::speed_t = 0o010007;
pub const B1000000: ::speed_t = 0o010010;
pub const B1152000: ::speed_t = 0o010011;
pub const B1500000: ::speed_t = 0o010012;
pub const B2000000: ::speed_t = 0o010013;
pub const B2500000: ::speed_t = 0o010014;
pub const B3000000: ::speed_t = 0o010015;
pub const B3500000: ::speed_t = 0o010016;
pub const B4000000: ::speed_t = 0o010017;
pub const SO_BINDTODEVICE: ::c_int = 25;
pub const SO_TIMESTAMP: ::c_int = 29;
pub const SO_MARK: ::c_int = 36;
pub const SO_RXQ_OVFL: ::c_int = 40;
pub const SO_PEEK_OFF: ::c_int = 42;
pub const SO_BUSY_POLL: ::c_int = 46;
pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const O_ASYNC: ::c_int = 0x00000400;
pub const FIOCLEX: ::c_int = 0x5451;
pub const FIONBIO: ::c_int = 0x5421;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_AS: ::c_int = 9;
pub const RLIMIT_NPROC: ::c_int = 6;
pub const RLIMIT_MEMLOCK: ::c_int = 8;
pub const O_APPEND: ::c_int = 0x00100000;
pub const O_CREAT: ::c_int = 0x00010000;
pub const O_EXCL: ::c_int = 0x00020000;
pub const O_NOCTTY: ::c_int = 0x00000200;
pub const O_NONBLOCK: ::c_int = 0x00000010;
pub const O_SYNC: ::c_int = 0x00000040 | O_DSYNC;
pub const O_RSYNC: ::c_int = O_SYNC;
pub const O_DSYNC: ::c_int = 0x00000020;
pub const SOCK_CLOEXEC: ::c_int = 0o2000000;
pub const SOCK_NONBLOCK: ::c_int = 0o4000;
pub const MAP_ANON: ::c_int = 0x0020;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_DENYWRITE: ::c_int = 0x0800;
pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_LOCKED: ::c_int = 0x02000;
pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = 1;
pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
pub const ENOLCK: ::c_int = 37;
pub const ENOSYS: ::c_int = 38;
pub const ENOTEMPTY: ::c_int = 39;
pub const ELOOP: ::c_int = 40;
pub const ENOMSG: ::c_int = 42;
pub const EIDRM: ::c_int = 43;
pub const ECHRNG: ::c_int = 44;
pub const EL2NSYNC: ::c_int = 45;
pub const EL3HLT: ::c_int = 46;
pub const EL3RST: ::c_int = 47;
pub const ELNRNG: ::c_int = 48;
pub const EUNATCH: ::c_int = 49;
pub const ENOCSI: ::c_int = 50;
pub const EL2HLT: ::c_int = 51;
pub const EBADE: ::c_int = 52;
pub const EBADR: ::c_int = 53;
pub const EXFULL: ::c_int = 54;
pub const ENOANO: ::c_int = 55;
pub const EBADRQC: ::c_int = 56;
pub const EBADSLT: ::c_int = 57;
pub const EDEADLOCK: ::c_int = EDEADLK;
pub const EMULTIHOP: ::c_int = 72;
pub const EBADMSG: ::c_int = 74;
pub const EOVERFLOW: ::c_int = 75;
pub const ENOTUNIQ: ::c_int = 76;
pub const EBADFD: ::c_int = 77;
pub const EREMCHG: ::c_int = 78;
pub const ELIBACC: ::c_int = 79;
pub const ELIBBAD: ::c_int = 80;
pub const ELIBSCN: ::c_int = 81;
pub const ELIBMAX: ::c_int = 82;
pub const ELIBEXEC: ::c_int = 83;
pub const EILSEQ: ::c_int = 84;
pub const ERESTART: ::c_int = 85;
pub const ESTRPIPE: ::c_int = 86;
pub const EUSERS: ::c_int = 87;
pub const ENOTSOCK: ::c_int = 88;
pub const EDESTADDRREQ: ::c_int = 89;
pub const EMSGSIZE: ::c_int = 90;
pub const EPROTOTYPE: ::c_int = 91;
pub const ENOPROTOOPT: ::c_int = 92;
pub const EPROTONOSUPPORT: ::c_int = 93;
pub const ESOCKTNOSUPPORT: ::c_int = 94;
pub const EOPNOTSUPP: ::c_int = 95;
pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 96;
pub const EAFNOSUPPORT: ::c_int = 97;
pub const EADDRINUSE: ::c_int = 98;
pub const EADDRNOTAVAIL: ::c_int = 99;
pub const ENETDOWN: ::c_int = 100;
pub const ENETUNREACH: ::c_int = 101;
pub const ENETRESET: ::c_int = 102;
pub const ECONNABORTED: ::c_int = 103;
pub const ECONNRESET: ::c_int = 104;
pub const ENOBUFS: ::c_int = 105;
pub const EISCONN: ::c_int = 106;
pub const ENOTCONN: ::c_int = 107;
pub const ESHUTDOWN: ::c_int = 108;
pub const ETOOMANYREFS: ::c_int = 109;
pub const ETIMEDOUT: ::c_int = 110;
pub const ECONNREFUSED: ::c_int = 111;
pub const EHOSTDOWN: ::c_int = 112;
pub const EHOSTUNREACH: ::c_int = 113;
pub const EALREADY: ::c_int = 114;
pub const EINPROGRESS: ::c_int = 115;
pub const ESTALE: ::c_int = 116;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
pub const ENAVAIL: ::c_int = 119;
pub const EISNAM: ::c_int = 120;
pub const EREMOTEIO: ::c_int = 121;
pub const EDQUOT: ::c_int = 122;
pub const ENOMEDIUM: ::c_int = 123;
pub const EMEDIUMTYPE: ::c_int = 124;
pub const ECANCELED: ::c_int = 125;
pub const ENOKEY: ::c_int = 126;
pub const EKEYEXPIRED: ::c_int = 127;
pub const EKEYREVOKED: ::c_int = 128;
pub const EKEYREJECTED: ::c_int = 129;
pub const EOWNERDEAD: ::c_int = 130;
pub const ENOTRECOVERABLE: ::c_int = 131;
pub const ERFKILL: ::c_int = 132;
pub const EHWPOISON: ::c_int = 133;
pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
pub const SO_DONTROUTE: ::c_int = 5;
pub const SO_BROADCAST: ::c_int = 6;
pub const SO_SNDBUF: ::c_int = 7;
pub const SO_RCVBUF: ::c_int = 8;
pub const SO_KEEPALIVE: ::c_int = 9;
pub const SO_OOBINLINE: ::c_int = 10;
pub const SO_NO_CHECK: ::c_int = 11;
pub const SO_PRIORITY: ::c_int = 12;
pub const SO_LINGER: ::c_int = 13;
pub const SO_BSDCOMPAT: ::c_int = 14;
pub const SO_REUSEPORT: ::c_int = 15;
pub const SO_PASSCRED: ::c_int = 16;
pub const SO_PEERCRED: ::c_int = 17;
pub const SO_RCVLOWAT: ::c_int = 18;
pub const SO_SNDLOWAT: ::c_int = 19;
pub const SO_RCVTIMEO: ::c_int = 20;
pub const SO_SNDTIMEO: ::c_int = 21;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_SNDBUFFORCE: ::c_int = 32;
pub const SO_RCVBUFFORCE: ::c_int = 33;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;
pub const SA_ONSTACK: ::c_int = 0x08000000;
pub const SA_SIGINFO: ::c_int = 0x00000004;
pub const SA_NOCLDWAIT: ::c_int = 0x00000002;
pub const SIGCHLD: ::c_int = 17;
pub const SIGBUS: ::c_int = 7;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGUSR1: ::c_int = 10;
pub const SIGUSR2: ::c_int = 12;
pub const SIGCONT: ::c_int = 18;
pub const SIGSTOP: ::c_int = 19;
pub const SIGTSTP: ::c_int = 20;
pub const SIGURG: ::c_int = 23;
pub const SIGIO: ::c_int = 29;
pub const SIGSYS: ::c_int = 31;
pub const SIGSTKFLT: ::c_int = 16;
pub const SIGPOLL: ::c_int = 29;
pub const SIGPWR: ::c_int = 30;
pub const SIG_SETMASK: ::c_int = 2;
pub const SIG_BLOCK: ::c_int = 0x000000;
pub const SIG_UNBLOCK: ::c_int = 0x01;
pub const EXTPROC: ::tcflag_t = 0x00010000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const F_GETLK: ::c_int = 5;
pub const F_GETOWN: ::c_int = 9;
pub const F_SETLK: ::c_int = 6;
pub const F_SETLKW: ::c_int = 7;
pub const F_SETOWN: ::c_int = 8;
pub const VEOF: usize = 4;
pub const VEOL: usize = 11;
pub const VEOL2: usize = 16;
pub const VMIN: usize = 6;
pub const IEXTEN: ::tcflag_t = 0x00008000;
pub const TOSTOP: ::tcflag_t = 0x00000100;
pub const FLUSHO: ::tcflag_t = 0x00001000;
pub const TCGETS: ::c_int = 0x5401;
pub const TCSETS: ::c_int = 0x5402;
pub const TCSETSW: ::c_int = 0x5403;
pub const TCSETSF: ::c_int = 0x5404;
pub const TCGETA: ::c_int = 0x5405;
pub const TCSETA: ::c_int = 0x5406;
pub const TCSETAW: ::c_int = 0x5407;
pub const TCSETAF: ::c_int = 0x5408;
pub const TCSBRK: ::c_int = 0x5409;
pub const TCXONC: ::c_int = 0x540A;
pub const TCFLSH: ::c_int = 0x540B;
pub const TIOCGSOFTCAR: ::c_int = 0x5419;
pub const TIOCSSOFTCAR: ::c_int = 0x541A;
pub const TIOCLINUX: ::c_int = 0x541C;
pub const TIOCGSERIAL: ::c_int = 0x541E;
pub const TIOCEXCL: ::c_int = 0x540C;
pub const TIOCNXCL: ::c_int = 0x540D;
pub const TIOCSCTTY: ::c_int = 0x540E;
pub const TIOCGPGRP: ::c_int = 0x540F;
pub const TIOCSPGRP: ::c_int = 0x5410;
pub const TIOCOUTQ: ::c_int = 0x5411;
pub const TIOCSTI: ::c_int = 0x5412;
pub const TIOCGWINSZ: ::c_int = 0x5413;
pub const TIOCSWINSZ: ::c_int = 0x5414;
pub const TIOCMGET: ::c_int = 0x5415;
pub const TIOCMBIS: ::c_int = 0x5416;
pub const TIOCMBIC: ::c_int = 0x5417;
pub const TIOCMSET: ::c_int = 0x5418;
pub const FIONREAD: ::c_int = 0x541B;
pub const TIOCCONS: ::c_int = 0x541D;
pub const POLLWRNORM: ::c_short = 0x100;
pub const POLLWRBAND: ::c_short = 0x200;
pub const TIOCM_LE: ::c_int = 0x001;
pub const TIOCM_DTR: ::c_int = 0x002;
pub const TIOCM_RTS: ::c_int = 0x004;
pub const TIOCM_ST: ::c_int = 0x008;
pub const TIOCM_SR: ::c_int = 0x010;
pub const TIOCM_CTS: ::c_int = 0x020;
pub const TIOCM_CAR: ::c_int = 0x040;
pub const TIOCM_RNG: ::c_int = 0x080;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const O_DIRECTORY: ::c_int = 0x00080000;
pub const O_DIRECT: ::c_int = 0x00000800;
pub const O_LARGEFILE: ::c_int = 0x00001000;
pub const O_NOFOLLOW: ::c_int = 0x00000080;
pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26;
pub const MAP_HUGE_SHIFT: u32 = 26;
// intentionally not public, only used for fd_set
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
const ULONG_SIZE: usize = 32;
} else if #[cfg(target_pointer_width = "64")] {
const ULONG_SIZE: usize = 64;
} else {
// Unknown target_pointer_width
}
}
// END_PUB_CONST
f! {
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
(*set).fds_bits[fd / size] &= !(1 << (fd % size));
return
}
pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0
}
pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
let fd = fd as usize;
let size = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
(*set).fds_bits[fd / size] |= 1 << (fd % size);
return
}
pub fn FD_ZERO(set: *mut fd_set) -> () {
for slot in (*set).fds_bits.iter_mut() {
*slot = 0;
}
}
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.bits.iter_mut() {
*slot = 0;
}
}
pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
let size_in_bits
= 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
cpuset.bits[idx] |= 1 << offset;
()
}
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
let size_in_bits
= 8 * ::mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
cpuset.bits[idx] &= !(1 << offset);
()
}
pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
let size_in_bits = 8 * ::mem::size_of_val(&cpuset.bits[0]);
let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits);
0 != (cpuset.bits[idx] & (1 << offset))
}
pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool {
set1.bits == set2.bits
}
pub fn major(dev: ::dev_t) -> ::c_uint {
let mut major = 0;
major |= (dev & 0x00000000000fff00) >> 8;
major |= (dev & 0xfffff00000000000) >> 32;
major as ::c_uint
}
pub fn minor(dev: ::dev_t) -> ::c_uint {
let mut minor = 0;
minor |= (dev & 0x00000000000000ff) >> 0;
minor |= (dev & 0x00000ffffff00000) >> 12;
minor as ::c_uint
}
pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar {
cmsg.offset(1) as *mut c_uchar
}
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr)
-> *mut cmsghdr
{
if ((*cmsg).cmsg_len as ::size_t) < ::mem::size_of::() {
0 as *mut cmsghdr
} else if __CMSG_NEXT(cmsg).add(::mem::size_of::())
>= __MHDR_END(mhdr) {
0 as *mut cmsghdr
} else {
__CMSG_NEXT(cmsg).cast()
}
}
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as ::size_t >= ::mem::size_of::() {
(*mhdr).msg_control.cast()
} else {
0 as *mut cmsghdr
}
}
pub {const} fn CMSG_ALIGN(len: ::size_t) -> ::size_t {
(len + ::mem::size_of::<::size_t>() - 1)
& !(::mem::size_of::<::size_t>() - 1)
}
pub {const} fn CMSG_SPACE(len: ::c_uint) -> ::c_uint {
(CMSG_ALIGN(len as ::size_t) + CMSG_ALIGN(::mem::size_of::()))
as ::c_uint
}
pub {const} fn CMSG_LEN(len: ::c_uint) -> ::c_uint {
(CMSG_ALIGN(::mem::size_of::()) + len as ::size_t) as ::c_uint
}
}
safe_f! {
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0xff) == 0x7f
}
pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
(status >> 8) & 0xff
}
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0xffff
}
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
((status & 0x7f) + 1) as i8 >= 2
}
pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
status & 0x7f
}
pub {const} fn WIFEXITED(status: ::c_int) -> bool {
(status & 0x7f) == 0
}
pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
(status >> 8) & 0xff
}
pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0x80) != 0
}
pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
(cmd << 8) | (type_ & 0x00ff)
}
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= (major & 0x00000fff) << 8;
dev |= (major & 0xfffff000) << 32;
dev |= (minor & 0x000000ff) << 0;
dev |= (minor & 0xffffff00) << 12;
dev
}
}
fn __CMSG_LEN(cmsg: *const cmsghdr) -> ::ssize_t {
((unsafe { (*cmsg).cmsg_len as ::size_t } + ::mem::size_of::<::c_long>() - 1)
& !(::mem::size_of::<::c_long>() - 1)) as ::ssize_t
}
fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar {
(unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar
}
fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar {
unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast()
}
// EXTERN_FN
#[link(name = "c")]
#[link(name = "fdio")]
extern "C" {}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
impl ::Copy for FILE {}
impl ::Clone for FILE {
fn clone(&self) -> FILE {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {} // FIXME: fill this out with a struct
impl ::Copy for fpos_t {}
impl ::Clone for fpos_t {
fn clone(&self) -> fpos_t {
*self
}
}
extern "C" {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn isgraph(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn ispunct(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn isupper(c: c_int) -> c_int;
pub fn isxdigit(c: c_int) -> c_int;
pub fn isblank(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE;
pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE;
pub fn fflush(file: *mut FILE) -> c_int;
pub fn fclose(file: *mut FILE) -> c_int;
pub fn remove(filename: *const c_char) -> c_int;
pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int;
pub fn tmpfile() -> *mut FILE;
pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int;
pub fn setbuf(stream: *mut FILE, buf: *mut c_char);
pub fn getchar() -> c_int;
pub fn putchar(c: c_int) -> c_int;
pub fn fgetc(stream: *mut FILE) -> c_int;
pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char;
pub fn fputc(c: c_int, stream: *mut FILE) -> c_int;
pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int;
pub fn puts(s: *const c_char) -> c_int;
pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int;
pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t;
pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int;
pub fn ftell(stream: *mut FILE) -> c_long;
pub fn rewind(stream: *mut FILE);
pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int;
pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int;
pub fn feof(stream: *mut FILE) -> c_int;
pub fn ferror(stream: *mut FILE) -> c_int;
pub fn perror(s: *const c_char);
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn strtod(s: *const c_char, endp: *mut *mut c_char) -> c_double;
pub fn strtof(s: *const c_char, endp: *mut *mut c_char) -> c_float;
pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long;
pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong;
pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong;
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
pub fn free(p: *mut c_void);
pub fn abort() -> !;
pub fn exit(status: c_int) -> !;
pub fn _exit(status: c_int) -> !;
pub fn atexit(cb: extern "C" fn()) -> c_int;
pub fn system(s: *const c_char) -> c_int;
pub fn getenv(s: *const c_char) -> *mut c_char;
pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char;
pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char;
pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int;
pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int;
pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int;
pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char;
pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char;
pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t;
pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t;
pub fn strdup(cs: *const c_char) -> *mut c_char;
pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t;
pub fn strerror(n: c_int) -> *mut c_char;
pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char;
pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t;
pub fn wcslen(buf: *const wchar_t) -> size_t;
pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> ::size_t;
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn abs(i: c_int) -> c_int;
pub fn labs(i: c_long) -> c_long;
pub fn rand() -> c_int;
pub fn srand(seed: c_uint);
pub fn getpwnam(name: *const ::c_char) -> *mut passwd;
pub fn getpwuid(uid: ::uid_t) -> *mut passwd;
pub fn fprintf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn printf(format: *const ::c_char, ...) -> ::c_int;
pub fn snprintf(s: *mut ::c_char, n: ::size_t, format: *const ::c_char, ...) -> ::c_int;
pub fn sprintf(s: *mut ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn fscanf(stream: *mut ::FILE, format: *const ::c_char, ...) -> ::c_int;
pub fn scanf(format: *const ::c_char, ...) -> ::c_int;
pub fn sscanf(s: *const ::c_char, format: *const ::c_char, ...) -> ::c_int;
pub fn getchar_unlocked() -> ::c_int;
pub fn putchar_unlocked(c: ::c_int) -> ::c_int;
pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;
pub fn connect(socket: ::c_int, address: *const sockaddr, len: socklen_t) -> ::c_int;
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
pub fn accept(socket: ::c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> ::c_int;
pub fn getpeername(
socket: ::c_int,
address: *mut sockaddr,
address_len: *mut socklen_t,
) -> ::c_int;
pub fn getsockname(
socket: ::c_int,
address: *mut sockaddr,
address_len: *mut socklen_t,
) -> ::c_int;
pub fn setsockopt(
socket: ::c_int,
level: ::c_int,
name: ::c_int,
value: *const ::c_void,
option_len: socklen_t,
) -> ::c_int;
pub fn socketpair(
domain: ::c_int,
type_: ::c_int,
protocol: ::c_int,
socket_vector: *mut ::c_int,
) -> ::c_int;
pub fn sendto(
socket: ::c_int,
buf: *const ::c_void,
len: ::size_t,
flags: ::c_int,
addr: *const sockaddr,
addrlen: socklen_t,
) -> ::ssize_t;
pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int;
pub fn chmod(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn fchmod(fd: ::c_int, mode: mode_t) -> ::c_int;
pub fn fstat(fildes: ::c_int, buf: *mut stat) -> ::c_int;
pub fn mkdir(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn stat(path: *const c_char, buf: *mut stat) -> ::c_int;
pub fn pclose(stream: *mut ::FILE) -> ::c_int;
pub fn fdopen(fd: ::c_int, mode: *const c_char) -> *mut ::FILE;
pub fn fileno(stream: *mut ::FILE) -> ::c_int;
pub fn open(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn creat(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn fcntl(fd: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn opendir(dirname: *const c_char) -> *mut ::DIR;
pub fn readdir(dirp: *mut ::DIR) -> *mut ::dirent;
pub fn readdir_r(dirp: *mut ::DIR, entry: *mut ::dirent, result: *mut *mut ::dirent)
-> ::c_int;
pub fn closedir(dirp: *mut ::DIR) -> ::c_int;
pub fn rewinddir(dirp: *mut ::DIR);
pub fn openat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
pub fn fchmodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
flags: ::c_int,
) -> ::c_int;
pub fn fchown(fd: ::c_int, owner: ::uid_t, group: ::gid_t) -> ::c_int;
pub fn fchownat(
dirfd: ::c_int,
pathname: *const ::c_char,
owner: ::uid_t,
group: ::gid_t,
flags: ::c_int,
) -> ::c_int;
pub fn fstatat(
dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut stat,
flags: ::c_int,
) -> ::c_int;
pub fn linkat(
olddirfd: ::c_int,
oldpath: *const ::c_char,
newdirfd: ::c_int,
newpath: *const ::c_char,
flags: ::c_int,
) -> ::c_int;
pub fn mkdirat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn readlinkat(
dirfd: ::c_int,
pathname: *const ::c_char,
buf: *mut ::c_char,
bufsiz: ::size_t,
) -> ::ssize_t;
pub fn renameat(
olddirfd: ::c_int,
oldpath: *const ::c_char,
newdirfd: ::c_int,
newpath: *const ::c_char,
) -> ::c_int;
pub fn symlinkat(
target: *const ::c_char,
newdirfd: ::c_int,
linkpath: *const ::c_char,
) -> ::c_int;
pub fn unlinkat(dirfd: ::c_int, pathname: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn access(path: *const c_char, amode: ::c_int) -> ::c_int;
pub fn alarm(seconds: ::c_uint) -> ::c_uint;
pub fn chdir(dir: *const c_char) -> ::c_int;
pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> ::c_int;
pub fn close(fd: ::c_int) -> ::c_int;
pub fn dup(fd: ::c_int) -> ::c_int;
pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> ::c_int;
pub fn execle(path: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
pub fn execlp(file: *const ::c_char, arg0: *const ::c_char, ...) -> ::c_int;
pub fn execv(prog: *const c_char, argv: *const *const c_char) -> ::c_int;
pub fn execve(
prog: *const c_char,
argv: *const *const c_char,
envp: *const *const c_char,
) -> ::c_int;
pub fn execvp(c: *const c_char, argv: *const *const c_char) -> ::c_int;
pub fn fork() -> pid_t;
pub fn fpathconf(filedes: ::c_int, name: ::c_int) -> c_long;
pub fn getcwd(buf: *mut c_char, size: ::size_t) -> *mut c_char;
pub fn getegid() -> gid_t;
pub fn geteuid() -> uid_t;
pub fn getgid() -> gid_t;
pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
pub fn getlogin() -> *mut c_char;
pub fn getopt(argc: ::c_int, argv: *const *mut c_char, optstr: *const c_char) -> ::c_int;
pub fn getpgid(pid: pid_t) -> pid_t;
pub fn getpgrp() -> pid_t;
pub fn getpid() -> pid_t;
pub fn getppid() -> pid_t;
pub fn getuid() -> uid_t;
pub fn isatty(fd: ::c_int) -> ::c_int;
pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;
pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;
pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long;
pub fn pause() -> ::c_int;
pub fn pipe(fds: *mut ::c_int) -> ::c_int;
pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
pub fn read(fd: ::c_int, buf: *mut ::c_void, count: ::size_t) -> ::ssize_t;
pub fn rmdir(path: *const c_char) -> ::c_int;
pub fn seteuid(uid: uid_t) -> ::c_int;
pub fn setegid(gid: gid_t) -> ::c_int;
pub fn setgid(gid: gid_t) -> ::c_int;
pub fn setpgid(pid: pid_t, pgid: pid_t) -> ::c_int;
pub fn setsid() -> pid_t;
pub fn setuid(uid: uid_t) -> ::c_int;
pub fn sleep(secs: ::c_uint) -> ::c_uint;
pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::c_int;
pub fn tcgetpgrp(fd: ::c_int) -> pid_t;
pub fn tcsetpgrp(fd: ::c_int, pgrp: ::pid_t) -> ::c_int;
pub fn ttyname(fd: ::c_int) -> *mut c_char;
pub fn unlink(c: *const c_char) -> ::c_int;
pub fn wait(status: *mut ::c_int) -> pid_t;
pub fn waitpid(pid: pid_t, status: *mut ::c_int, options: ::c_int) -> pid_t;
pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
pub fn pread(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pub fn pwrite(fd: ::c_int, buf: *const ::c_void, count: ::size_t, offset: off_t) -> ::ssize_t;
pub fn umask(mask: mode_t) -> mode_t;
pub fn utime(file: *const c_char, buf: *const utimbuf) -> ::c_int;
pub fn kill(pid: pid_t, sig: ::c_int) -> ::c_int;
pub fn mlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn munlock(addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn mlockall(flags: ::c_int) -> ::c_int;
pub fn munlockall() -> ::c_int;
pub fn mmap(
addr: *mut ::c_void,
len: ::size_t,
prot: ::c_int,
flags: ::c_int,
fd: ::c_int,
offset: off_t,
) -> *mut ::c_void;
pub fn munmap(addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pub fn if_nametoindex(ifname: *const c_char) -> ::c_uint;
pub fn if_indextoname(ifindex: ::c_uint, ifname: *mut ::c_char) -> *mut ::c_char;
pub fn lstat(path: *const c_char, buf: *mut stat) -> ::c_int;
pub fn fsync(fd: ::c_int) -> ::c_int;
pub fn setenv(name: *const c_char, val: *const c_char, overwrite: ::c_int) -> ::c_int;
pub fn unsetenv(name: *const c_char) -> ::c_int;
pub fn symlink(path1: *const c_char, path2: *const c_char) -> ::c_int;
pub fn ftruncate(fd: ::c_int, length: off_t) -> ::c_int;
pub fn signal(signum: ::c_int, handler: sighandler_t) -> sighandler_t;
pub fn realpath(pathname: *const ::c_char, resolved: *mut ::c_char) -> *mut ::c_char;
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn times(buf: *mut ::tms) -> ::clock_t;
pub fn pthread_self() -> ::pthread_t;
pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
pub fn pthread_exit(value: *mut ::c_void) -> !;
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getstacksize(
attr: *const ::pthread_attr_t,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
pub fn pthread_attr_setdetachstate(attr: *mut ::pthread_attr_t, state: ::c_int) -> ::c_int;
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
pub fn sched_yield() -> ::c_int;
pub fn pthread_key_create(
key: *mut pthread_key_t,
dtor: ::Option,
) -> ::c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> ::c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut ::c_void;
pub fn pthread_setspecific(key: pthread_key_t, value: *const ::c_void) -> ::c_int;
pub fn pthread_mutex_init(
lock: *mut pthread_mutex_t,
attr: *const pthread_mutexattr_t,
) -> ::c_int;
pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> ::c_int;
pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> ::c_int;
pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: ::c_int) -> ::c_int;
pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t)
-> ::c_int;
pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_cond_timedwait(
cond: *mut pthread_cond_t,
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> ::c_int;
pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> ::c_int;
pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> ::c_int;
pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> ::c_int;
pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> ::c_int;
pub fn pthread_rwlock_init(
lock: *mut pthread_rwlock_t,
attr: *const pthread_rwlockattr_t,
) -> ::c_int;
pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> ::c_int;
pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> ::c_int;
pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> ::c_int;
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn getsockopt(
sockfd: ::c_int,
level: ::c_int,
optname: ::c_int,
optval: *mut ::c_void,
optlen: *mut ::socklen_t,
) -> ::c_int;
pub fn raise(signum: ::c_int) -> ::c_int;
pub fn sigaction(signum: ::c_int, act: *const sigaction, oldact: *mut sigaction) -> ::c_int;
pub fn utimes(filename: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn dlopen(filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
pub fn dlerror() -> *mut ::c_char;
pub fn dlsym(handle: *mut ::c_void, symbol: *const ::c_char) -> *mut ::c_void;
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
pub fn getaddrinfo(
node: *const c_char,
service: *const c_char,
hints: *const addrinfo,
res: *mut *mut addrinfo,
) -> ::c_int;
pub fn freeaddrinfo(res: *mut addrinfo);
pub fn gai_strerror(errcode: ::c_int) -> *const ::c_char;
pub fn res_init() -> ::c_int;
pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm;
pub fn mktime(tm: *mut tm) -> time_t;
pub fn time(time: *mut time_t) -> time_t;
pub fn gmtime(time_p: *const time_t) -> *mut tm;
pub fn localtime(time_p: *const time_t) -> *mut tm;
pub fn mknod(pathname: *const ::c_char, mode: ::mode_t, dev: ::dev_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn gethostname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn getservbyname(name: *const ::c_char, proto: *const ::c_char) -> *mut servent;
pub fn getprotobyname(name: *const ::c_char) -> *mut protoent;
pub fn getprotobynumber(proto: ::c_int) -> *mut protoent;
pub fn usleep(secs: ::c_uint) -> ::c_int;
pub fn send(socket: ::c_int, buf: *const ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
pub fn recv(socket: ::c_int, buf: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::ssize_t;
pub fn putenv(string: *mut c_char) -> ::c_int;
pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: ::c_int) -> ::c_int;
pub fn select(
nfds: ::c_int,
readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *mut timeval,
) -> ::c_int;
pub fn setlocale(category: ::c_int, locale: *const ::c_char) -> *mut ::c_char;
pub fn localeconv() -> *mut lconv;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
pub fn sem_post(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> ::c_int;
pub fn fstatvfs(fd: ::c_int, buf: *mut statvfs) -> ::c_int;
pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: ::size_t) -> ::ssize_t;
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
pub fn sigfillset(set: *mut sigset_t) -> ::c_int;
pub fn sigdelset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
pub fn sigismember(set: *const sigset_t, signum: ::c_int) -> ::c_int;
pub fn sigprocmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sigpending(set: *mut sigset_t) -> ::c_int;
pub fn timegm(tm: *mut ::tm) -> time_t;
pub fn getsid(pid: pid_t) -> pid_t;
pub fn sysconf(name: ::c_int) -> ::c_long;
pub fn mkfifo(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn pselect(
nfds: ::c_int,
readfds: *mut fd_set,
writefds: *mut fd_set,
errorfds: *mut fd_set,
timeout: *const timespec,
sigmask: *const sigset_t,
) -> ::c_int;
pub fn fseeko(stream: *mut ::FILE, offset: ::off_t, whence: ::c_int) -> ::c_int;
pub fn ftello(stream: *mut ::FILE) -> ::off_t;
pub fn tcdrain(fd: ::c_int) -> ::c_int;
pub fn cfgetispeed(termios: *const ::termios) -> ::speed_t;
pub fn cfgetospeed(termios: *const ::termios) -> ::speed_t;
pub fn cfmakeraw(termios: *mut ::termios);
pub fn cfsetispeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn cfsetospeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn cfsetspeed(termios: *mut ::termios, speed: ::speed_t) -> ::c_int;
pub fn tcgetattr(fd: ::c_int, termios: *mut ::termios) -> ::c_int;
pub fn tcsetattr(fd: ::c_int, optional_actions: ::c_int, termios: *const ::termios) -> ::c_int;
pub fn tcflow(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcflush(fd: ::c_int, action: ::c_int) -> ::c_int;
pub fn tcgetsid(fd: ::c_int) -> ::pid_t;
pub fn tcsendbreak(fd: ::c_int, duration: ::c_int) -> ::c_int;
pub fn mkstemp(template: *mut ::c_char) -> ::c_int;
pub fn mkdtemp(template: *mut ::c_char) -> *mut ::c_char;
pub fn tmpnam(ptr: *mut ::c_char) -> *mut ::c_char;
pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int);
pub fn closelog();
pub fn setlogmask(maskpri: ::c_int) -> ::c_int;
pub fn syslog(priority: ::c_int, message: *const ::c_char, ...);
pub fn grantpt(fd: ::c_int) -> ::c_int;
pub fn posix_openpt(flags: ::c_int) -> ::c_int;
pub fn ptsname(fd: ::c_int) -> *mut ::c_char;
pub fn unlockpt(fd: ::c_int) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn setgroups(ngroups: ::size_t, ptr: *const ::gid_t) -> ::c_int;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn fdopendir(fd: ::c_int) -> *mut ::DIR;
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn pthread_condattr_getclock(
attr: *const pthread_condattr_t,
clock_id: *mut clockid_t,
) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
pub fn accept4(
fd: ::c_int,
addr: *mut ::sockaddr,
len: *mut ::socklen_t,
flg: ::c_int,
) -> ::c_int;
pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn clearenv() -> ::c_int;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
-> ::c_int;
pub fn setreuid(ruid: ::uid_t, euid: ::uid_t) -> ::c_int;
pub fn setregid(rgid: ::gid_t, egid: ::gid_t) -> ::c_int;
pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
pub fn openpty(
amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *const termios,
winp: *const ::winsize,
) -> ::c_int;
pub fn execvpe(
file: *const ::c_char,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn fexecve(
fd: ::c_int,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn setpwent();
pub fn endpwent();
pub fn getpwent() -> *mut passwd;
pub fn shm_open(name: *const c_char, oflag: ::c_int, mode: mode_t) -> ::c_int;
// System V IPC
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
pub fn semop(semid: ::c_int, sops: *mut ::sembuf, nsops: ::size_t) -> ::c_int;
pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn msgsnd(
msqid: ::c_int,
msgp: *const ::c_void,
msgsz: ::size_t,
msgflg: ::c_int,
) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn __errno_location() -> *mut ::c_int;
pub fn fallocate(fd: ::c_int, mode: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn readahead(fd: ::c_int, offset: ::off64_t, count: ::size_t) -> ::ssize_t;
pub fn signalfd(fd: ::c_int, mask: *const ::sigset_t, flags: ::c_int) -> ::c_int;
pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
pub fn timerfd_settime(
fd: ::c_int,
flags: ::c_int,
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> ::c_int;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn quotactl(
cmd: ::c_int,
special: *const ::c_char,
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
pub fn dup3(oldfd: ::c_int, newfd: ::c_int, flags: ::c_int) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
host: *mut ::c_char,
hostlen: ::socklen_t,
serv: *mut ::c_char,
servlen: ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn reboot(how_to: ::c_int) -> ::c_int;
pub fn setfsgid(gid: ::gid_t) -> ::c_int;
pub fn setfsuid(uid: ::uid_t) -> ::c_int;
// Not available now on Android
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn sync_file_range(
fd: ::c_int,
offset: ::off64_t,
nbytes: ::off64_t,
flags: ::c_uint,
) -> ::c_int;
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
pub fn glob(
pattern: *const c_char,
flags: ::c_int,
errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
len: ::size_t,
flags: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn vhangup() -> ::c_int;
pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn recvmmsg(
sockfd: ::c_int,
msgvec: *mut mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;
pub fn sync();
pub fn syscall(num: ::c_long, ...) -> ::c_long;
pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, cpuset: *mut cpu_set_t)
-> ::c_int;
pub fn sched_setaffinity(
pid: ::pid_t,
cpusetsize: ::size_t,
cpuset: *const cpu_set_t,
) -> ::c_int;
pub fn umount(target: *const ::c_char) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn tee(fd_in: ::c_int, fd_out: ::c_int, len: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn splice(
fd_in: ::c_int,
off_in: *mut ::loff_t,
fd_out: ::c_int,
off_out: *mut ::loff_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
pub fn vmsplice(
fd: ::c_int,
iov: *const ::iovec,
nr_segs: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
pub fn mount(
src: *const ::c_char,
target: *const ::c_char,
fstype: *const ::c_char,
flags: ::c_ulong,
data: *const ::c_void,
) -> ::c_int;
pub fn personality(persona: ::c_ulong) -> ::c_int;
pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
pub fn ppoll(
fds: *mut ::pollfd,
nfds: nfds_t,
timeout: *const ::timespec,
sigmask: *const sigset_t,
) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn clone(
cb: extern "C" fn(*mut ::c_void) -> ::c_int,
child_stack: *mut ::c_void,
flags: ::c_int,
arg: *mut ::c_void,
...
) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn umount2(target: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn swapon(path: *const ::c_char, swapflags: ::c_int) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,
policy: ::c_int,
param: *const ::sched_param,
) -> ::c_int;
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn initgroups(user: *const ::c_char, group: ::gid_t) -> ::c_int;
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
pub fn getpwuid_r(
uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
pub fn pthread_atfork(
prepare: ::Option,
parent: ::Option,
child: ::Option,
) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn setgrent();
pub fn endgrent();
pub fn getgrent() -> *mut ::group;
pub fn getgrouplist(
user: *const ::c_char,
group: ::gid_t,
groups: *mut ::gid_t,
ngroups: *mut ::c_int,
) -> ::c_int;
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn dl_iterate_phdr(
callback: ::Option<
unsafe extern "C" fn(
info: *mut ::dl_phdr_info,
size: ::size_t,
data: *mut ::c_void,
) -> ::c_int,
>,
data: *mut ::c_void,
) -> ::c_int;
}
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(any(target_arch = "x86_64"))] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(any(target_arch = "riscv64"))] {
mod riscv64;
pub use self::riscv64::*;
} else {
// Unknown target_arch
}
}
cfg_if! {
if #[cfg(libc_align)] {
#[macro_use]
mod align;
} else {
#[macro_use]
mod no_align;
}
}
expand_align!();
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
libc-0.2.152/src/fuchsia/no_align.rs 0000644 0000000 0000000 00000011654 10461020230 0015260 0 ustar 0000000 0000000 macro_rules! expand_align {
() => {
s! {
pub struct pthread_mutexattr_t {
#[cfg(target_arch = "x86_64")]
__align: [::c_int; 0],
#[cfg(not(target_arch = "x86_64"))]
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEXATTR_T],
}
pub struct pthread_rwlockattr_t {
__align: [::c_long; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCKATTR_T],
}
pub struct pthread_condattr_t {
__align: [::c_int; 0],
size: [u8; ::__SIZEOF_PTHREAD_CONDATTR_T],
}
}
s_no_extra_traits! {
pub struct pthread_mutex_t {
#[cfg(any(target_arch = "arm",
all(target_arch = "x86_64",
target_pointer_width = "32")))]
__align: [::c_long; 0],
#[cfg(not(any(target_arch = "arm",
all(target_arch = "x86_64",
target_pointer_width = "32"))))]
__align: [::c_longlong; 0],
size: [u8; ::__SIZEOF_PTHREAD_MUTEX_T],
}
pub struct pthread_rwlock_t {
__align: [::c_long; 0],
__align: [::c_longlong; 0],
size: [u8; ::__SIZEOF_PTHREAD_RWLOCK_T],
}
pub struct pthread_cond_t {
__align: [*const ::c_void; 0],
#[cfg(not(target_env = "musl"))]
__align: [::c_longlong; 0],
size: [u8; ::__SIZEOF_PTHREAD_COND_T],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
// Ignore __align field
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
// Ignore __align field
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash(&self, state: &mut H) {
// Ignore __align field
self.size.hash(state);
}
}
impl PartialEq for pthread_mutex_t {
fn eq(&self, other: &pthread_mutex_t) -> bool {
// Ignore __align field
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_mutex_t {}
impl ::fmt::Debug for pthread_mutex_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_mutex_t")
// Ignore __align field
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_mutex_t {
fn hash(&self, state: &mut H) {
// Ignore __align field
self.size.hash(state);
}
}
impl PartialEq for pthread_rwlock_t {
fn eq(&self, other: &pthread_rwlock_t) -> bool {
// Ignore __align field
self.size
.iter()
.zip(other.size.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_rwlock_t {}
impl ::fmt::Debug for pthread_rwlock_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_rwlock_t")
// Ignore __align field
// FIXME: .field("size", &self.size)
.finish()
}
}
impl ::hash::Hash for pthread_rwlock_t {
fn hash(&self, state: &mut H) {
// Ignore __align field
self.size.hash(state);
}
}
}
}
};
}
libc-0.2.152/src/fuchsia/riscv64.rs 0000644 0000000 0000000 00000002221 10461020230 0014760 0 ustar 0000000 0000000 // From psABI Calling Convention for RV64
pub type c_char = u8;
pub type __u64 = ::c_ulonglong;
pub type wchar_t = i32;
pub type nlink_t = ::c_ulong;
pub type blksize_t = ::c_long;
pub type stat64 = stat;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
// Not actually used, IPC calls just return ENOSYS
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_ushort,
__unused1: ::c_ulong,
__unused2: ::c_ulong,
}
}
libc-0.2.152/src/fuchsia/x86_64.rs 0000644 0000000 0000000 00000010706 10461020230 0014425 0 ustar 0000000 0000000 pub type c_char = i8;
pub type wchar_t = i32;
pub type nlink_t = u64;
pub type blksize_t = ::c_long;
pub type __u64 = ::c_ulonglong;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__unused: [::c_long; 3],
}
pub struct stat64 {
pub st_dev: ::dev_t,
pub st_ino: ::ino64_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
__pad0: ::c_int,
pub st_rdev: ::dev_t,
pub st_size: ::off_t,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt64_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
__reserved: [::c_long; 3],
}
pub struct mcontext_t {
__private: [u64; 32],
}
pub struct ipc_perm {
pub __ipc_perm_key: ::key_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub __seq: ::c_int,
__unused1: ::c_long,
__unused2: ::c_long
}
}
s_no_extra_traits! {
pub struct ucontext_t {
pub uc_flags: ::c_ulong,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
pub uc_sigmask: ::sigset_t,
__private: [u8; 512],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for ucontext_t {
fn eq(&self, other: &ucontext_t) -> bool {
self.uc_flags == other.uc_flags
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_sigmask == other.uc_sigmask
&& self
.__private
.iter()
.zip(other.__private.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_flags", &self.uc_flags)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_mcontext", &self.uc_mcontext)
.field("uc_sigmask", &self.uc_sigmask)
// FIXME: .field("__private", &self.__private)
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash(&self, state: &mut H) {
self.uc_flags.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_mcontext.hash(state);
self.uc_sigmask.hash(state);
self.__private.hash(state);
}
}
}
}
// offsets in user_regs_structs, from sys/reg.h
pub const R15: ::c_int = 0;
pub const R14: ::c_int = 1;
pub const R13: ::c_int = 2;
pub const R12: ::c_int = 3;
pub const RBP: ::c_int = 4;
pub const RBX: ::c_int = 5;
pub const R11: ::c_int = 6;
pub const R10: ::c_int = 7;
pub const R9: ::c_int = 8;
pub const R8: ::c_int = 9;
pub const RAX: ::c_int = 10;
pub const RCX: ::c_int = 11;
pub const RDX: ::c_int = 12;
pub const RSI: ::c_int = 13;
pub const RDI: ::c_int = 14;
pub const ORIG_RAX: ::c_int = 15;
pub const RIP: ::c_int = 16;
pub const CS: ::c_int = 17;
pub const EFLAGS: ::c_int = 18;
pub const RSP: ::c_int = 19;
pub const SS: ::c_int = 20;
pub const FS_BASE: ::c_int = 21;
pub const GS_BASE: ::c_int = 22;
pub const DS: ::c_int = 23;
pub const ES: ::c_int = 24;
pub const FS: ::c_int = 25;
pub const GS: ::c_int = 26;
pub const MAP_32BIT: ::c_int = 0x0040;
pub const SIGSTKSZ: ::size_t = 8192;
pub const MINSIGSTKSZ: ::size_t = 2048;
libc-0.2.152/src/hermit/aarch64.rs 0000644 0000000 0000000 00000000056 10461020230 0014562 0 ustar 0000000 0000000 pub type c_char = u8;
pub type wchar_t = u32;
libc-0.2.152/src/hermit/mod.rs 0000644 0000000 0000000 00000002710 10461020230 0014110 0 ustar 0000000 0000000 //! Hermit C types definition
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wint_t = u32;
pub type wctype_t = i64;
pub type regoff_t = size_t;
pub type off_t = c_long;
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else {
// Unknown target_arch
}
}
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
libc-0.2.152/src/hermit/x86_64.rs 0000644 0000000 0000000 00000000056 10461020230 0014270 0 ustar 0000000 0000000 pub type c_char = i8;
pub type wchar_t = i32;
libc-0.2.152/src/lib.rs 0000644 0000000 0000000 00000011016 10461020230 0012606 0 ustar 0000000 0000000 //! libc - Raw FFI bindings to platforms' system libraries
#![crate_name = "libc"]
#![crate_type = "rlib"]
#![allow(
renamed_and_removed_lints, // Keep this order.
unknown_lints, // Keep this order.
bad_style,
overflowing_literals,
improper_ctypes,
// This lint is renamed but we run CI for old stable rustc so should be here.
redundant_semicolon,
redundant_semicolons,
unused_macros,
unused_macro_rules,
)]
#![cfg_attr(libc_deny_warnings, deny(warnings))]
// Attributes needed when building as part of the standard library
#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))]
#![cfg_attr(libc_thread_local, feature(thread_local))]
// Enable extra lints:
#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))]
#![deny(missing_copy_implementations, safe_packed_borrows)]
#![cfg_attr(not(feature = "rustc-dep-of-std"), no_std)]
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]
#[macro_use]
mod macros;
cfg_if! {
if #[cfg(feature = "rustc-dep-of-std")] {
extern crate rustc_std_workspace_core as core;
#[allow(unused_imports)]
use core::iter;
#[allow(unused_imports)]
use core::ops;
#[allow(unused_imports)]
use core::option;
}
}
cfg_if! {
if #[cfg(libc_priv_mod_use)] {
#[cfg(libc_core_cvoid)]
#[allow(unused_imports)]
use core::ffi;
#[allow(unused_imports)]
use core::fmt;
#[allow(unused_imports)]
use core::hash;
#[allow(unused_imports)]
use core::num;
#[allow(unused_imports)]
use core::mem;
#[doc(hidden)]
#[allow(unused_imports)]
use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
use core::option::Option;
} else {
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::fmt;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::hash;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::num;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::mem;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::clone::Clone;
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::marker::{Copy, Send, Sync};
#[doc(hidden)]
#[allow(unused_imports)]
pub use core::option::Option;
}
}
cfg_if! {
if #[cfg(windows)] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod windows;
pub use windows::*;
} else if #[cfg(target_os = "fuchsia")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod fuchsia;
pub use fuchsia::*;
} else if #[cfg(target_os = "switch")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod switch;
pub use switch::*;
} else if #[cfg(target_os = "psp")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod psp;
pub use psp::*;
} else if #[cfg(target_os = "vxworks")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod vxworks;
pub use vxworks::*;
} else if #[cfg(target_os = "solid_asp3")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod solid;
pub use solid::*;
} else if #[cfg(unix)] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod unix;
pub use unix::*;
} else if #[cfg(target_os = "hermit")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod hermit;
pub use hermit::*;
} else if #[cfg(target_os = "teeos")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod teeos;
pub use teeos::*;
} else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod sgx;
pub use sgx::*;
} else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod wasi;
pub use wasi::*;
} else if #[cfg(target_os = "xous")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod xous;
pub use xous::*;
} else {
// non-supported targets: empty...
}
}
libc-0.2.152/src/macros.rs 0000644 0000000 0000000 00000025166 10461020230 0013337 0 ustar 0000000 0000000 /// A macro for defining #[cfg] if-else statements.
///
/// This is similar to the `if/elif` C preprocessor macro by allowing definition
/// of a cascade of `#[cfg]` cases, emitting the implementation which matches
/// first.
///
/// This allows you to conveniently provide a long list #[cfg]'d blocks of code
/// without having to rewrite each clause multiple times.
macro_rules! cfg_if {
// match if/else chains with a final `else`
($(
if #[cfg($($meta:meta),*)] { $($it:item)* }
) else * else {
$($it2:item)*
}) => {
cfg_if! {
@__items
() ;
$( ( ($($meta),*) ($($it)*) ), )*
( () ($($it2)*) ),
}
};
// match if/else chains lacking a final `else`
(
if #[cfg($($i_met:meta),*)] { $($i_it:item)* }
$(
else if #[cfg($($e_met:meta),*)] { $($e_it:item)* }
)*
) => {
cfg_if! {
@__items
() ;
( ($($i_met),*) ($($i_it)*) ),
$( ( ($($e_met),*) ($($e_it)*) ), )*
( () () ),
}
};
// Internal and recursive macro to emit all the items
//
// Collects all the negated `cfg`s in a list at the beginning and after the
// semicolon is all the remaining items
(@__items ($($not:meta,)*) ; ) => {};
(@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ),
$($rest:tt)*) => {
// Emit all items within one block, applying an appropriate #[cfg]. The
// #[cfg] will require all `$m` matchers specified and must also negate
// all previous matchers.
cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* }
// Recurse to emit all other items in `$rest`, and when we do so add all
// our `$m` matchers to the list of `$not` matchers as future emissions
// will have to negate everything we just matched as well.
cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
};
// Internal macro to Apply a cfg attribute to a list of items
(@__apply $m:meta, $($it:item)*) => {
$(#[$m] $it)*
};
}
macro_rules! s {
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
s!(it: $(#[$attr])* pub $t $i { $($field)* });
)*);
(it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
compile_error!("unions cannot derive extra traits, use s_no_extra_traits instead");
);
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
#[allow(deprecated)]
$(#[$attr])*
pub struct $i { $($field)* }
}
#[allow(deprecated)]
impl ::Copy for $i {}
#[allow(deprecated)]
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
);
}
macro_rules! s_no_extra_traits {
($($(#[$attr:meta])* pub $t:ident $i:ident { $($field:tt)* })*) => ($(
s_no_extra_traits!(it: $(#[$attr])* pub $t $i { $($field)* });
)*);
(it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => (
cfg_if! {
if #[cfg(libc_union)] {
__item! {
#[repr(C)]
$(#[$attr])*
pub union $i { $($field)* }
}
impl ::Copy for $i {}
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
}
}
);
(it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => (
__item! {
#[repr(C)]
$(#[$attr])*
pub struct $i { $($field)* }
}
#[allow(deprecated)]
impl ::Copy for $i {}
#[allow(deprecated)]
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
);
}
macro_rules! missing {
($($(#[$attr:meta])* pub enum $i:ident {})*) => ($(
$(#[$attr])* #[allow(missing_copy_implementations)] pub enum $i { }
)*);
}
macro_rules! e {
($($(#[$attr:meta])* pub enum $i:ident { $($field:tt)* })*) => ($(
__item! {
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
$(#[$attr])*
pub enum $i { $($field)* }
}
impl ::Copy for $i {}
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
)*);
}
macro_rules! s_paren {
($($(#[$attr:meta])* pub struct $i:ident ( $($field:tt)* ); )* ) => ($(
__item! {
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
$(#[$attr])*
pub struct $i ( $($field)* );
}
impl ::Copy for $i {}
impl ::Clone for $i {
fn clone(&self) -> $i { *self }
}
)*);
}
// This is a pretty horrible hack to allow us to conditionally mark
// some functions as 'const', without requiring users of this macro
// to care about the "const-extern-fn" feature.
//
// When 'const-extern-fn' is enabled, we emit the captured 'const' keyword
// in the expanded function.
//
// When 'const-extern-fn' is disabled, we always emit a plain 'pub unsafe extern fn'.
// Note that the expression matched by the macro is exactly the same - this allows
// users of this macro to work whether or not 'const-extern-fn' is enabled
//
// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks.
// This is because 'const unsafe extern fn' won't even parse on older compilers,
// so we need to avoid emitting it at all of 'const-extern-fn'.
//
// Specifically, moving the 'cfg_if' into the macro body will *not* work.
// Doing so would cause the '#[cfg(feature = "const-extern-fn")]' to be emitted
// into user code. The 'cfg' gate will not stop Rust from trying to parse the
// 'pub const unsafe extern fn', so users would get a compiler error even when
// the 'const-extern-fn' feature is disabled
//
// Note that users of this macro need to place 'const' in a weird position
// (after the closing ')' for the arguments, but before the return type).
// This was the only way I could satisfy the following two requirements:
// 1. Avoid ambiguity errors from 'macro_rules!' (which happen when writing '$foo:ident fn'
// 2. Allow users of this macro to mix 'pub fn foo' and 'pub const fn bar' within the same
// 'f!' block
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
macro_rules! f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* unsafe extern fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
macro_rules! safe_f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
pub $($constness)* extern fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
macro_rules! const_fn {
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
$($constness)* fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
} else {
macro_rules! f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
pub unsafe extern fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
macro_rules! safe_f {
($($(#[$attr:meta])* pub $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
pub extern fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
macro_rules! const_fn {
($($(#[$attr:meta])* $({$constness:ident})* fn $i:ident(
$($arg:ident: $argty:ty),*
) -> $ret:ty {
$($body:stmt);*
})*) => ($(
#[inline]
$(#[$attr])*
fn $i($($arg: $argty),*
) -> $ret {
$($body);*
}
)*)
}
}
}
macro_rules! __item {
($i:item) => {
$i
};
}
macro_rules! align_const {
($($(#[$attr:meta])*
pub const $name:ident : $t1:ty
= $t2:ident { $($field:tt)* };)*) => ($(
#[cfg(libc_align)]
$(#[$attr])*
pub const $name : $t1 = $t2 {
$($field)*
};
#[cfg(not(libc_align))]
$(#[$attr])*
pub const $name : $t1 = $t2 {
$($field)*
__align: [],
};
)*)
}
// This macro is used to deprecate items that should be accessed via the mach2 crate
macro_rules! deprecated_mach {
(pub const $id:ident: $ty:ty = $expr:expr;) => {
#[deprecated(
since = "0.2.55",
note = "Use the `mach2` crate instead",
)]
#[allow(deprecated)]
pub const $id: $ty = $expr;
};
($(pub const $id:ident: $ty:ty = $expr:expr;)*) => {
$(
deprecated_mach!(
pub const $id: $ty = $expr;
);
)*
};
(pub type $id:ident = $ty:ty;) => {
#[deprecated(
since = "0.2.55",
note = "Use the `mach2` crate instead",
)]
#[allow(deprecated)]
pub type $id = $ty;
};
($(pub type $id:ident = $ty:ty;)*) => {
$(
deprecated_mach!(
pub type $id = $ty;
);
)*
}
}
#[cfg(not(libc_ptr_addr_of))]
macro_rules! ptr_addr_of {
($place:expr) => {
&$place
};
}
#[cfg(libc_ptr_addr_of)]
macro_rules! ptr_addr_of {
($place:expr) => {
::core::ptr::addr_of!($place)
};
}
libc-0.2.152/src/psp.rs 0000644 0000000 0000000 00000367564 10461020230 0012670 0 ustar 0000000 0000000 //! PSP C type definitions
//!
//! These type declarations are not enough, as they must be ultimately resolved
//! by the linker. Crates that use these definitions must, somewhere in the
//! crate graph, include a stub provider crate such as the `psp` crate.
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
pub type SceKernelVTimerHandler = unsafe extern "C" fn(
uid: SceUid,
arg1: *mut SceKernelSysClock,
arg2: *mut SceKernelSysClock,
arg3: *mut c_void,
) -> u32;
pub type SceKernelVTimerHandlerWide =
unsafe extern "C" fn(uid: SceUid, arg1: i64, arg2: i64, arg3: *mut c_void) -> u32;
pub type SceKernelThreadEventHandler =
unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32;
pub type SceKernelAlarmHandler = unsafe extern "C" fn(common: *mut c_void) -> u32;
pub type SceKernelCallbackFunction =
unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32;
pub type SceKernelThreadEntry = unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32;
pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32);
pub type IoPermissions = i32;
pub type UmdCallback = fn(unknown: i32, event: i32) -> i32;
pub type SceMpegRingbufferCb =
::Option i32>;
pub type GuCallback = ::Option;
pub type GuSwapBuffersCallback =
::Option;
pub type SceNetAdhocctlHandler =
::Option;
pub type AdhocMatchingCallback = ::Option<
unsafe extern "C" fn(
matching_id: i32,
event: i32,
mac: *mut u8,
opt_len: i32,
opt_data: *mut c_void,
),
>;
pub type SceNetApctlHandler = ::Option<
unsafe extern "C" fn(oldState: i32, newState: i32, event: i32, error: i32, pArg: *mut c_void),
>;
pub type HttpMallocFunction = ::Option *mut c_void>;
pub type HttpReallocFunction =
::Option *mut c_void>;
pub type HttpFreeFunction = ::Option;
pub type HttpPasswordCB = ::Option<
unsafe extern "C" fn(
request: i32,
auth_type: HttpAuthType,
realm: *const u8,
username: *mut u8,
password: *mut u8,
need_entity: i32,
entity_body: *mut *mut u8,
entity_size: *mut usize,
save: *mut i32,
) -> i32,
>;
pub type socklen_t = u32;
e! {
#[repr(u32)]
pub enum AudioFormat {
Stereo = 0,
Mono = 0x10,
}
#[repr(u32)]
pub enum DisplayMode {
Lcd = 0,
}
#[repr(u32)]
pub enum DisplayPixelFormat {
Psm5650 = 0,
Psm5551 = 1,
Psm4444 = 2,
Psm8888 = 3,
}
#[repr(u32)]
pub enum DisplaySetBufSync {
Immediate = 0,
NextFrame = 1,
}
#[repr(i32)]
pub enum AudioOutputFrequency {
Khz48 = 48000,
Khz44_1 = 44100,
Khz32 = 32000,
Khz24 = 24000,
Khz22_05 = 22050,
Khz16 = 16000,
Khz12 = 12000,
Khz11_025 = 11025,
Khz8 = 8000,
}
#[repr(i32)]
pub enum AudioInputFrequency {
Khz44_1 = 44100,
Khz22_05 = 22050,
Khz11_025 = 11025,
}
#[repr(u32)]
pub enum CtrlMode {
Digital = 0,
Analog,
}
#[repr(i32)]
pub enum GeMatrixType {
Bone0 = 0,
Bone1,
Bone2,
Bone3,
Bone4,
Bone5,
Bone6,
Bone7,
World,
View,
Projection,
TexGen,
}
#[repr(i32)]
pub enum GeListState {
Done = 0,
Queued,
DrawingDone,
StallReached,
CancelDone,
}
#[repr(u8)]
pub enum GeCommand {
Nop = 0,
Vaddr = 0x1,
Iaddr = 0x2,
Prim = 0x4,
Bezier = 0x5,
Spline = 0x6,
BoundingBox = 0x7,
Jump = 0x8,
BJump = 0x9,
Call = 0xa,
Ret = 0xb,
End = 0xc,
Signal = 0xe,
Finish = 0xf,
Base = 0x10,
VertexType = 0x12,
OffsetAddr = 0x13,
Origin = 0x14,
Region1 = 0x15,
Region2 = 0x16,
LightingEnable = 0x17,
LightEnable0 = 0x18,
LightEnable1 = 0x19,
LightEnable2 = 0x1a,
LightEnable3 = 0x1b,
DepthClampEnable = 0x1c,
CullFaceEnable = 0x1d,
TextureMapEnable = 0x1e,
FogEnable = 0x1f,
DitherEnable = 0x20,
AlphaBlendEnable = 0x21,
AlphaTestEnable = 0x22,
ZTestEnable = 0x23,
StencilTestEnable = 0x24,
AntiAliasEnable = 0x25,
PatchCullEnable = 0x26,
ColorTestEnable = 0x27,
LogicOpEnable = 0x28,
BoneMatrixNumber = 0x2a,
BoneMatrixData = 0x2b,
MorphWeight0 = 0x2c,
MorphWeight1 = 0x2d,
MorphWeight2 = 0x2e,
MorphWeight3 = 0x2f,
MorphWeight4 = 0x30,
MorphWeight5 = 0x31,
MorphWeight6 = 0x32,
MorphWeight7 = 0x33,
PatchDivision = 0x36,
PatchPrimitive = 0x37,
PatchFacing = 0x38,
WorldMatrixNumber = 0x3a,
WorldMatrixData = 0x3b,
ViewMatrixNumber = 0x3c,
ViewMatrixData = 0x3d,
ProjMatrixNumber = 0x3e,
ProjMatrixData = 0x3f,
TGenMatrixNumber = 0x40,
TGenMatrixData = 0x41,
ViewportXScale = 0x42,
ViewportYScale = 0x43,
ViewportZScale = 0x44,
ViewportXCenter = 0x45,
ViewportYCenter = 0x46,
ViewportZCenter = 0x47,
TexScaleU = 0x48,
TexScaleV = 0x49,
TexOffsetU = 0x4a,
TexOffsetV = 0x4b,
OffsetX = 0x4c,
OffsetY = 0x4d,
ShadeMode = 0x50,
ReverseNormal = 0x51,
MaterialUpdate = 0x53,
MaterialEmissive = 0x54,
MaterialAmbient = 0x55,
MaterialDiffuse = 0x56,
MaterialSpecular = 0x57,
MaterialAlpha = 0x58,
MaterialSpecularCoef = 0x5b,
AmbientColor = 0x5c,
AmbientAlpha = 0x5d,
LightMode = 0x5e,
LightType0 = 0x5f,
LightType1 = 0x60,
LightType2 = 0x61,
LightType3 = 0x62,
Light0X = 0x63,
Light0Y,
Light0Z,
Light1X,
Light1Y,
Light1Z,
Light2X,
Light2Y,
Light2Z,
Light3X,
Light3Y,
Light3Z,
Light0DirectionX = 0x6f,
Light0DirectionY,
Light0DirectionZ,
Light1DirectionX,
Light1DirectionY,
Light1DirectionZ,
Light2DirectionX,
Light2DirectionY,
Light2DirectionZ,
Light3DirectionX,
Light3DirectionY,
Light3DirectionZ,
Light0ConstantAtten = 0x7b,
Light0LinearAtten,
Light0QuadtraticAtten,
Light1ConstantAtten,
Light1LinearAtten,
Light1QuadtraticAtten,
Light2ConstantAtten,
Light2LinearAtten,
Light2QuadtraticAtten,
Light3ConstantAtten,
Light3LinearAtten,
Light3QuadtraticAtten,
Light0ExponentAtten = 0x87,
Light1ExponentAtten,
Light2ExponentAtten,
Light3ExponentAtten,
Light0CutoffAtten = 0x8b,
Light1CutoffAtten,
Light2CutoffAtten,
Light3CutoffAtten,
Light0Ambient = 0x8f,
Light0Diffuse,
Light0Specular,
Light1Ambient,
Light1Diffuse,
Light1Specular,
Light2Ambient,
Light2Diffuse,
Light2Specular,
Light3Ambient,
Light3Diffuse,
Light3Specular,
Cull = 0x9b,
FrameBufPtr = 0x9c,
FrameBufWidth = 0x9d,
ZBufPtr = 0x9e,
ZBufWidth = 0x9f,
TexAddr0 = 0xa0,
TexAddr1,
TexAddr2,
TexAddr3,
TexAddr4,
TexAddr5,
TexAddr6,
TexAddr7,
TexBufWidth0 = 0xa8,
TexBufWidth1,
TexBufWidth2,
TexBufWidth3,
TexBufWidth4,
TexBufWidth5,
TexBufWidth6,
TexBufWidth7,
ClutAddr = 0xb0,
ClutAddrUpper = 0xb1,
TransferSrc,
TransferSrcW,
TransferDst,
TransferDstW,
TexSize0 = 0xb8,
TexSize1,
TexSize2,
TexSize3,
TexSize4,
TexSize5,
TexSize6,
TexSize7,
TexMapMode = 0xc0,
TexShadeLs = 0xc1,
TexMode = 0xc2,
TexFormat = 0xc3,
LoadClut = 0xc4,
ClutFormat = 0xc5,
TexFilter = 0xc6,
TexWrap = 0xc7,
TexLevel = 0xc8,
TexFunc = 0xc9,
TexEnvColor = 0xca,
TexFlush = 0xcb,
TexSync = 0xcc,
Fog1 = 0xcd,
Fog2 = 0xce,
FogColor = 0xcf,
TexLodSlope = 0xd0,
FramebufPixFormat = 0xd2,
ClearMode = 0xd3,
Scissor1 = 0xd4,
Scissor2 = 0xd5,
MinZ = 0xd6,
MaxZ = 0xd7,
ColorTest = 0xd8,
ColorRef = 0xd9,
ColorTestmask = 0xda,
AlphaTest = 0xdb,
StencilTest = 0xdc,
StencilOp = 0xdd,
ZTest = 0xde,
BlendMode = 0xdf,
BlendFixedA = 0xe0,
BlendFixedB = 0xe1,
Dith0 = 0xe2,
Dith1,
Dith2,
Dith3,
LogicOp = 0xe6,
ZWriteDisable = 0xe7,
MaskRgb = 0xe8,
MaskAlpha = 0xe9,
TransferStart = 0xea,
TransferSrcPos = 0xeb,
TransferDstPos = 0xec,
TransferSize = 0xee,
Vscx = 0xf0,
Vscy = 0xf1,
Vscz = 0xf2,
Vtcs = 0xf3,
Vtct = 0xf4,
Vtcq = 0xf5,
Vcv = 0xf6,
Vap = 0xf7,
Vfc = 0xf8,
Vscv = 0xf9,
Unknown03 = 0x03,
Unknown0D = 0x0d,
Unknown11 = 0x11,
Unknown29 = 0x29,
Unknown34 = 0x34,
Unknown35 = 0x35,
Unknown39 = 0x39,
Unknown4E = 0x4e,
Unknown4F = 0x4f,
Unknown52 = 0x52,
Unknown59 = 0x59,
Unknown5A = 0x5a,
UnknownB6 = 0xb6,
UnknownB7 = 0xb7,
UnknownD1 = 0xd1,
UnknownED = 0xed,
UnknownEF = 0xef,
UnknownFA = 0xfa,
UnknownFB = 0xfb,
UnknownFC = 0xfc,
UnknownFD = 0xfd,
UnknownFE = 0xfe,
NopFF = 0xff,
}
#[repr(i32)]
pub enum SceSysMemPartitionId {
SceKernelUnknownPartition = 0,
SceKernelPrimaryKernelPartition = 1,
SceKernelPrimaryUserPartition = 2,
SceKernelOtherKernelPartition1 = 3,
SceKernelOtherKernelPartition2 = 4,
SceKernelVshellPARTITION = 5,
SceKernelScUserPartition = 6,
SceKernelMeUserPartition = 7,
SceKernelExtendedScKernelPartition = 8,
SceKernelExtendedSc2KernelPartition = 9,
SceKernelExtendedMeKernelPartition = 10,
SceKernelVshellKernelPartition = 11,
SceKernelExtendedKernelPartition = 12,
}
#[repr(i32)]
pub enum SceSysMemBlockTypes {
Low = 0,
High,
Addr,
}
#[repr(u32)]
pub enum Interrupt {
Gpio = 4,
Ata = 5,
Umd = 6,
Mscm0 = 7,
Wlan = 8,
Audio = 10,
I2c = 12,
Sircs = 14,
Systimer0 = 15,
Systimer1 = 16,
Systimer2 = 17,
Systimer3 = 18,
Thread0 = 19,
Nand = 20,
Dmacplus = 21,
Dma0 = 22,
Dma1 = 23,
Memlmd = 24,
Ge = 25,
Vblank = 30,
Mecodec = 31,
Hpremote = 36,
Mscm1 = 60,
Mscm2 = 61,
Thread1 = 65,
Interrupt = 66,
}
#[repr(u32)]
pub enum SubInterrupt {
Gpio = Interrupt::Gpio as u32,
Ata = Interrupt::Ata as u32,
Umd = Interrupt::Umd as u32,
Dmacplus = Interrupt::Dmacplus as u32,
Ge = Interrupt::Ge as u32,
Display = Interrupt::Vblank as u32,
}
#[repr(u32)]
pub enum SceKernelIdListType {
Thread = 1,
Semaphore = 2,
EventFlag = 3,
Mbox = 4,
Vpl = 5,
Fpl = 6,
Mpipe = 7,
Callback = 8,
ThreadEventHandler = 9,
Alarm = 10,
VTimer = 11,
SleepThread = 64,
DelayThread = 65,
SuspendThread = 66,
DormantThread = 67,
}
#[repr(i32)]
pub enum UsbCamResolution {
Px160_120 = 0,
Px176_144 = 1,
Px320_240 = 2,
Px352_288 = 3,
Px640_480 = 4,
Px1024_768 = 5,
Px1280_960 = 6,
Px480_272 = 7,
Px360_272 = 8,
}
#[repr(i32)]
pub enum UsbCamResolutionEx {
Px160_120 = 0,
Px176_144 = 1,
Px320_240 = 2,
Px352_288 = 3,
Px360_272 = 4,
Px480_272 = 5,
Px640_480 = 6,
Px1024_768 = 7,
Px1280_960 = 8,
}
#[repr(i32)]
pub enum UsbCamDelay {
NoDelay = 0,
Delay10Sec = 1,
Delay20Sec = 2,
Delay30Sec = 3,
}
#[repr(i32)]
pub enum UsbCamFrameRate {
Fps3_75 = 0,
Fps5 = 1,
Fps7_5 = 2,
Fps10 = 3,
Fps15 = 4,
Fps20 = 5,
Fps30 = 6,
Fps60 = 7,
}
#[repr(i32)]
pub enum UsbCamWb {
Auto = 0,
Daylight = 1,
Fluorescent = 2,
Incadescent = 3,
}
#[repr(i32)]
pub enum UsbCamEffectMode {
Normal = 0,
Negative = 1,
Blackwhite = 2,
Sepia = 3,
Blue = 4,
Red = 5,
Green = 6,
}
#[repr(i32)]
pub enum UsbCamEvLevel {
Pos2_0 = 0,
Pos1_7 = 1,
Pos1_5 = 2,
Pos1_3 = 3,
Pos1_0 = 4,
Pos0_7 = 5,
Pos0_5 = 6,
Pos0_3 = 7,
Zero = 8,
Neg0_3,
Neg0_5,
Neg0_7,
Neg1_0,
Neg1_3,
Neg1_5,
Neg1_7,
Neg2_0,
}
#[repr(i32)]
pub enum RtcCheckValidError {
InvalidYear = -1,
InvalidMonth = -2,
InvalidDay = -3,
InvalidHour = -4,
InvalidMinutes = -5,
InvalidSeconds = -6,
InvalidMicroseconds = -7,
}
#[repr(u32)]
pub enum PowerTick {
All = 0,
Suspend = 1,
Display = 6,
}
#[repr(u32)]
pub enum IoAssignPerms {
RdWr = 0,
RdOnly = 1,
}
#[repr(u32)]
pub enum IoWhence {
Set = 0,
Cur = 1,
End = 2,
}
#[repr(u32)]
pub enum UmdType {
Game = 0x10,
Video = 0x20,
Audio = 0x40,
}
#[repr(u32)]
pub enum GuPrimitive {
Points = 0,
Lines = 1,
LineStrip = 2,
Triangles = 3,
TriangleStrip = 4,
TriangleFan = 5,
Sprites = 6,
}
#[repr(u32)]
pub enum PatchPrimitive {
Points = 0,
LineStrip = 2,
TriangleStrip = 4,
}
#[repr(u32)]
pub enum GuState {
AlphaTest = 0,
DepthTest = 1,
ScissorTest = 2,
StencilTest = 3,
Blend = 4,
CullFace = 5,
Dither = 6,
Fog = 7,
ClipPlanes = 8,
Texture2D = 9,
Lighting = 10,
Light0 = 11,
Light1 = 12,
Light2 = 13,
Light3 = 14,
LineSmooth = 15,
PatchCullFace = 16,
ColorTest = 17,
ColorLogicOp = 18,
FaceNormalReverse = 19,
PatchFace = 20,
Fragment2X = 21,
}
#[repr(u32)]
pub enum MatrixMode {
Projection = 0,
View = 1,
Model = 2,
Texture = 3,
}
#[repr(u32)]
pub enum TexturePixelFormat {
Psm5650 = 0,
Psm5551 = 1,
Psm4444 = 2,
Psm8888 = 3,
PsmT4 = 4,
PsmT8 = 5,
PsmT16 = 6,
PsmT32 = 7,
PsmDxt1 = 8,
PsmDxt3 = 9,
PsmDxt5 = 10,
}
#[repr(u32)]
pub enum SplineMode {
FillFill = 0,
OpenFill = 1,
FillOpen = 2,
OpenOpen = 3,
}
#[repr(u32)]
pub enum ShadingModel {
Flat = 0,
Smooth = 1,
}
#[repr(u32)]
pub enum LogicalOperation {
Clear = 0,
And = 1,
AndReverse = 2,
Copy = 3,
AndInverted = 4,
Noop = 5,
Xor = 6,
Or = 7,
Nor = 8,
Equiv = 9,
Inverted = 10,
OrReverse = 11,
CopyInverted = 12,
OrInverted = 13,
Nand = 14,
Set = 15,
}
#[repr(u32)]
pub enum TextureFilter {
Nearest = 0,
Linear = 1,
NearestMipmapNearest = 4,
LinearMipmapNearest = 5,
NearestMipmapLinear = 6,
LinearMipmapLinear = 7,
}
#[repr(u32)]
pub enum TextureMapMode {
TextureCoords = 0,
TextureMatrix = 1,
EnvironmentMap = 2,
}
#[repr(u32)]
pub enum TextureLevelMode {
Auto = 0,
Const = 1,
Slope = 2,
}
#[repr(u32)]
pub enum TextureProjectionMapMode {
Position = 0,
Uv = 1,
NormalizedNormal = 2,
Normal = 3,
}
#[repr(u32)]
pub enum GuTexWrapMode {
Repeat = 0,
Clamp = 1,
}
#[repr(u32)]
pub enum FrontFaceDirection {
Clockwise = 0,
CounterClockwise = 1,
}
#[repr(u32)]
pub enum AlphaFunc {
Never = 0,
Always,
Equal,
NotEqual,
Less,
LessOrEqual,
Greater,
GreaterOrEqual,
}
#[repr(u32)]
pub enum StencilFunc {
Never = 0,
Always,
Equal,
NotEqual,
Less,
LessOrEqual,
Greater,
GreaterOrEqual,
}
#[repr(u32)]
pub enum ColorFunc {
Never = 0,
Always,
Equal,
NotEqual,
}
#[repr(u32)]
pub enum DepthFunc {
Never = 0,
Always,
Equal,
NotEqual,
Less,
LessOrEqual,
Greater,
GreaterOrEqual,
}
#[repr(u32)]
pub enum TextureEffect {
Modulate = 0,
Decal = 1,
Blend = 2,
Replace = 3,
Add = 4,
}
#[repr(u32)]
pub enum TextureColorComponent {
Rgb = 0,
Rgba = 1,
}
#[repr(u32)]
pub enum MipmapLevel {
None = 0,
Level1,
Level2,
Level3,
Level4,
Level5,
Level6,
Level7,
}
#[repr(u32)]
pub enum BlendOp {
Add = 0,
Subtract = 1,
ReverseSubtract = 2,
Min = 3,
Max = 4,
Abs = 5,
}
#[repr(u32)]
pub enum BlendSrc {
SrcColor = 0,
OneMinusSrcColor = 1,
SrcAlpha = 2,
OneMinusSrcAlpha = 3,
Fix = 10,
}
#[repr(u32)]
pub enum BlendDst {
DstColor = 0,
OneMinusDstColor = 1,
DstAlpha = 4,
OneMinusDstAlpha = 5,
Fix = 10,
}
#[repr(u32)]
pub enum StencilOperation {
Keep = 0,
Zero = 1,
Replace = 2,
Invert = 3,
Incr = 4,
Decr = 5,
}
#[repr(u32)]
pub enum LightMode {
SingleColor = 0,
SeparateSpecularColor = 1,
}
#[repr(u32)]
pub enum LightType {
Directional = 0,
Pointlight = 1,
Spotlight = 2,
}
#[repr(u32)]
pub enum GuContextType {
Direct = 0,
Call = 1,
Send = 2,
}
#[repr(u32)]
pub enum GuQueueMode {
Tail = 0,
Head = 1,
}
#[repr(u32)]
pub enum GuSyncMode {
Finish = 0,
Signal = 1,
Done = 2,
List = 3,
Send = 4,
}
#[repr(u32)]
pub enum GuSyncBehavior {
Wait = 0,
NoWait = 1,
}
#[repr(u32)]
pub enum GuCallbackId {
Signal = 1,
Finish = 4,
}
#[repr(u32)]
pub enum SignalBehavior {
Suspend = 1,
Continue = 2,
}
#[repr(u32)]
pub enum ClutPixelFormat {
Psm5650 = 0,
Psm5551 = 1,
Psm4444 = 2,
Psm8888 = 3,
}
#[repr(C)]
pub enum KeyType {
Directory = 1,
Integer = 2,
String = 3,
Bytes = 4,
}
#[repr(u32)]
pub enum UtilityMsgDialogMode {
Error,
Text,
}
#[repr(u32)]
pub enum UtilityMsgDialogPressed {
Unknown1,
Yes,
No,
Back,
}
#[repr(u32)]
pub enum UtilityDialogButtonAccept {
Circle,
Cross,
}
#[repr(u32)]
pub enum SceUtilityOskInputLanguage {
Default,
Japanese,
English,
French,
Spanish,
German,
Italian,
Dutch,
Portugese,
Russian,
Korean,
}
#[repr(u32)]
pub enum SceUtilityOskInputType {
All,
LatinDigit,
LatinSymbol,
LatinLowercase = 4,
LatinUppercase = 8,
JapaneseDigit = 0x100,
JapaneseSymbol = 0x200,
JapaneseLowercase = 0x400,
JapaneseUppercase = 0x800,
JapaneseHiragana = 0x1000,
JapaneseHalfWidthKatakana = 0x2000,
JapaneseKatakana = 0x4000,
JapaneseKanji = 0x8000,
RussianLowercase = 0x10000,
RussianUppercase = 0x20000,
Korean = 0x40000,
Url = 0x80000,
}
#[repr(u32)]
pub enum SceUtilityOskState {
None,
Initializing,
Initialized,
Visible,
Quit,
Finished,
}
#[repr(u32)]
pub enum SceUtilityOskResult {
Unchanged,
Cancelled,
Changed,
}
#[repr(u32)]
pub enum SystemParamLanguage {
Japanese,
English,
French,
Spanish,
German,
Italian,
Dutch,
Portugese,
Russian,
Korean,
ChineseTraditional,
ChineseSimplified,
}
#[repr(u32)]
pub enum SystemParamId {
StringNickname = 1,
AdhocChannel,
WlanPowerSave,
DateFormat,
TimeFormat,
Timezone,
DaylightSavings,
Language,
Unknown,
}
#[repr(u32)]
pub enum SystemParamAdhocChannel {
ChannelAutomatic = 0,
Channel1 = 1,
Channel6 = 6,
Channel11 = 11,
}
#[repr(u32)]
pub enum SystemParamWlanPowerSaveState {
Off,
On,
}
#[repr(u32)]
pub enum SystemParamDateFormat {
YYYYMMDD,
MMDDYYYY,
DDMMYYYY,
}
#[repr(u32)]
pub enum SystemParamTimeFormat {
Hour24,
Hour12,
}
#[repr(u32)]
pub enum SystemParamDaylightSavings {
Std,
Dst,
}
#[repr(u32)]
pub enum AvModule {
AvCodec,
SasCore,
Atrac3Plus,
MpegBase,
Mp3,
Vaudio,
Aac,
G729,
}
#[repr(u32)]
pub enum Module {
NetCommon = 0x100,
NetAdhoc,
NetInet,
NetParseUri,
NetHttp,
NetSsl,
UsbPspCm = 0x200,
UsbMic,
UsbCam,
UsbGps,
AvCodec = 0x300,
AvSascore,
AvAtrac3Plus,
AvMpegBase,
AvMp3,
AvVaudio,
AvAac,
AvG729,
NpCommon = 0x400,
NpService,
NpMatching2,
NpDrm = 0x500,
Irda = 0x600,
}
#[repr(u32)]
pub enum NetModule {
NetCommon = 1,
NetAdhoc,
NetInet,
NetParseUri,
NetHttp,
NetSsl,
}
#[repr(u32)]
pub enum UsbModule {
UsbPspCm = 1,
UsbAcc,
UsbMic,
UsbCam,
UsbGps,
}
#[repr(u32)]
pub enum NetParam {
Name,
Ssid,
Secure,
WepKey,
IsStaticIp,
Ip,
NetMask,
Route,
ManualDns,
PrimaryDns,
SecondaryDns,
ProxyUser,
ProxyPass,
UseProxy,
ProxyServer,
ProxyPort,
Unknown1,
Unknown2,
}
#[repr(u32)]
pub enum UtilityNetconfAction {
ConnectAP,
DisplayStatus,
ConnectAdhoc,
}
#[repr(u32)]
pub enum UtilitySavedataMode {
AutoLoad,
AutoSave,
Load,
Save,
ListLoad,
ListSave,
ListDelete,
Delete,
}
#[repr(u32)]
pub enum UtilitySavedataFocus {
Unknown1,
FirstList,
LastList,
Latest,
Oldest,
Unknown2,
Unknown3,
FirstEmpty,
LastEmpty,
}
#[repr(u32)]
pub enum UtilityGameSharingMode {
Single = 1,
Multiple,
}
#[repr(u32)]
pub enum UtilityGameSharingDataType {
File = 1,
Memory,
}
#[repr(u32)]
pub enum UtilityHtmlViewerInterfaceMode {
Full,
Limited,
None,
}
#[repr(u32)]
pub enum UtilityHtmlViewerCookieMode {
Disabled = 0,
Enabled,
Confirm,
Default,
}
#[repr(u32)]
pub enum UtilityHtmlViewerTextSize {
Large,
Normal,
Small,
}
#[repr(u32)]
pub enum UtilityHtmlViewerDisplayMode {
Normal,
Fit,
SmartFit,
}
#[repr(u32)]
pub enum UtilityHtmlViewerConnectMode {
Last,
ManualOnce,
ManualAll,
}
#[repr(u32)]
pub enum UtilityHtmlViewerDisconnectMode {
Enable,
Disable,
Confirm,
}
#[repr(u32)]
pub enum ScePspnetAdhocPtpState {
Closed,
Listen,
SynSent,
SynReceived,
Established,
}
#[repr(u32)]
pub enum AdhocMatchingMode {
Host = 1,
Client,
Ptp,
}
#[repr(u32)]
pub enum ApctlState {
Disconnected,
Scanning,
Joining,
GettingIp,
GotIp,
EapAuth,
KeyExchange,
}
#[repr(u32)]
pub enum ApctlEvent {
ConnectRequest,
ScanRequest,
ScanComplete,
Established,
GetIp,
DisconnectRequest,
Error,
Info,
EapAuth,
KeyExchange,
Reconnect,
}
#[repr(u32)]
pub enum ApctlInfo {
ProfileName,
Bssid,
Ssid,
SsidLength,
SecurityType,
Strength,
Channel,
PowerSave,
Ip,
SubnetMask,
Gateway,
PrimaryDns,
SecondaryDns,
UseProxy,
ProxyUrl,
ProxyPort,
EapType,
StartBrowser,
Wifisp,
}
#[repr(u32)]
pub enum ApctlInfoSecurityType {
None,
Wep,
Wpa,
}
#[repr(u32)]
pub enum HttpMethod {
Get,
Post,
Head,
}
#[repr(u32)]
pub enum HttpAuthType {
Basic,
Digest,
}
}
s_paren! {
#[repr(transparent)]
pub struct SceUid(pub i32);
#[repr(transparent)]
#[allow(dead_code)]
pub struct SceMpeg(*mut *mut c_void);
#[repr(transparent)]
#[allow(dead_code)]
pub struct SceMpegStream(*mut c_void);
#[repr(transparent)]
pub struct Mp3Handle(pub i32);
#[repr(transparent)]
#[allow(dead_code)]
pub struct RegHandle(u32);
}
s! {
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: u8,
pub sa_data: [u8;14],
}
pub struct in_addr {
pub s_addr: u32,
}
pub struct AudioInputParams {
pub unknown1: i32,
pub gain: i32,
pub unknown2: i32,
pub unknown3: i32,
pub unknown4: i32,
pub unknown5: i32,
}
pub struct Atrac3BufferInfo {
pub puc_write_position_first_buf: *mut u8,
pub ui_writable_byte_first_buf: u32,
pub ui_min_write_byte_first_buf: u32,
pub ui_read_position_first_buf: u32,
pub puc_write_position_second_buf: *mut u8,
pub ui_writable_byte_second_buf: u32,
pub ui_min_write_byte_second_buf: u32,
pub ui_read_position_second_buf: u32,
}
pub struct SceCtrlData {
pub timestamp: u32,
pub buttons: i32,
pub lx: u8,
pub ly: u8,
pub rsrv: [u8; 6],
}
pub struct SceCtrlLatch {
pub ui_make: u32,
pub ui_break: u32,
pub ui_press: u32,
pub ui_release: u32,
}
pub struct GeStack {
pub stack: [u32; 8],
}
pub struct GeCallbackData {
pub signal_func: ::Option,
pub signal_arg: *mut c_void,
pub finish_func: ::Option,
pub finish_arg: *mut c_void,
}
pub struct GeListArgs {
pub size: u32,
pub context: *mut GeContext,
pub num_stacks: u32,
pub stacks: *mut GeStack,
}
pub struct GeBreakParam {
pub buf: [u32; 4],
}
pub struct SceKernelLoadExecParam {
pub size: usize,
pub args: usize,
pub argp: *mut c_void,
pub key: *const u8,
}
pub struct timeval {
pub tv_sec: i32,
pub tv_usec: i32,
}
pub struct timezone {
pub tz_minutes_west: i32,
pub tz_dst_time: i32,
}
pub struct IntrHandlerOptionParam {
size: i32,
entry: u32,
common: u32,
gp: u32,
intr_code: u16,
sub_count: u16,
intr_level: u16,
enabled: u16,
calls: u32,
field_1c: u32,
total_clock_lo: u32,
total_clock_hi: u32,
min_clock_lo: u32,
min_clock_hi: u32,
max_clock_lo: u32,
max_clock_hi: u32,
}
pub struct SceKernelLMOption {
pub size: usize,
pub m_pid_text: SceUid,
pub m_pid_data: SceUid,
pub flags: u32,
pub position: u8,
pub access: u8,
pub c_reserved: [u8; 2usize],
}
pub struct SceKernelSMOption {
pub size: usize,
pub m_pid_stack: SceUid,
pub stack_size: usize,
pub priority: i32,
pub attribute: u32,
}
pub struct SceKernelModuleInfo {
pub size: usize,
pub n_segment: u8,
pub reserved: [u8; 3usize],
pub segment_addr: [i32; 4usize],
pub segment_size: [i32; 4usize],
pub entry_addr: u32,
pub gp_value: u32,
pub text_addr: u32,
pub text_size: u32,
pub data_size: u32,
pub bss_size: u32,
pub attribute: u16,
pub version: [u8; 2usize],
pub name: [u8; 28usize],
}
pub struct DebugProfilerRegs {
pub enable: u32,
pub systemck: u32,
pub cpuck: u32,
pub internal: u32,
pub memory: u32,
pub copz: u32,
pub vfpu: u32,
pub sleep: u32,
pub bus_access: u32,
pub uncached_load: u32,
pub uncached_store: u32,
pub cached_load: u32,
pub cached_store: u32,
pub i_miss: u32,
pub d_miss: u32,
pub d_writeback: u32,
pub cop0_inst: u32,
pub fpu_inst: u32,
pub vfpu_inst: u32,
pub local_bus: u32,
}
pub struct SceKernelSysClock {
pub low: u32,
pub hi: u32,
}
pub struct SceKernelThreadOptParam {
pub size: usize,
pub stack_mpid: SceUid,
}
pub struct SceKernelThreadInfo {
pub size: usize,
pub name: [u8; 32],
pub attr: u32,
pub status: i32,
pub entry: SceKernelThreadEntry,
pub stack: *mut c_void,
pub stack_size: i32,
pub gp_reg: *mut c_void,
pub init_priority: i32,
pub current_priority: i32,
pub wait_type: i32,
pub wait_id: SceUid,
pub wakeup_count: i32,
pub exit_status: i32,
pub run_clocks: SceKernelSysClock,
pub intr_preempt_count: u32,
pub thread_preempt_count: u32,
pub release_count: u32,
}
pub struct SceKernelThreadRunStatus {
pub size: usize,
pub status: i32,
pub current_priority: i32,
pub wait_type: i32,
pub wait_id: i32,
pub wakeup_count: i32,
pub run_clocks: SceKernelSysClock,
pub intr_preempt_count: u32,
pub thread_preempt_count: u32,
pub release_count: u32,
}
pub struct SceKernelSemaOptParam {
pub size: usize,
}
pub struct SceKernelSemaInfo {
pub size: usize,
pub name: [u8; 32],
pub attr: u32,
pub init_count: i32,
pub current_count: i32,
pub max_count: i32,
pub num_wait_threads: i32,
}
pub struct SceKernelEventFlagInfo {
pub size: usize,
pub name: [u8; 32],
pub attr: u32,
pub init_pattern: u32,
pub current_pattern: u32,
pub num_wait_threads: i32,
}
pub struct SceKernelEventFlagOptParam {
pub size: usize,
}
pub struct SceKernelMbxOptParam {
pub size: usize,
}
pub struct SceKernelMbxInfo {
pub size: usize,
pub name: [u8; 32usize],
pub attr: u32,
pub num_wait_threads: i32,
pub num_messages: i32,
pub first_message: *mut c_void,
}
pub struct SceKernelVTimerInfo {
pub size: usize,
pub name: [u8; 32],
pub active: i32,
pub base: SceKernelSysClock,
pub current: SceKernelSysClock,
pub schedule: SceKernelSysClock,
pub handler: SceKernelVTimerHandler,
pub common: *mut c_void,
}
pub struct SceKernelThreadEventHandlerInfo {
pub size: usize,
pub name: [u8; 32],
pub thread_id: SceUid,
pub mask: i32,
pub handler: SceKernelThreadEventHandler,
pub common: *mut c_void,
}
pub struct SceKernelAlarmInfo {
pub size: usize,
pub schedule: SceKernelSysClock,
pub handler: SceKernelAlarmHandler,
pub common: *mut c_void,
}
pub struct SceKernelSystemStatus {
pub size: usize,
pub status: u32,
pub idle_clocks: SceKernelSysClock,
pub comes_out_of_idle_count: u32,
pub thread_switch_count: u32,
pub vfpu_switch_count: u32,
}
pub struct SceKernelMppInfo {
pub size: usize,
pub name: [u8; 32],
pub attr: u32,
pub buf_size: i32,
pub free_size: i32,
pub num_send_wait_threads: i32,
pub num_receive_wait_threads: i32,
}
pub struct SceKernelVplOptParam {
pub size: usize,
}
pub struct SceKernelVplInfo {
pub size: usize,
pub name: [u8; 32],
pub attr: u32,
pub pool_size: i32,
pub free_size: i32,
pub num_wait_threads: i32,
}
pub struct SceKernelFplOptParam {
pub size: usize,
}
pub struct SceKernelFplInfo {
pub size: usize,
pub name: [u8; 32usize],
pub attr: u32,
pub block_size: i32,
pub num_blocks: i32,
pub free_blocks: i32,
pub num_wait_threads: i32,
}
pub struct SceKernelVTimerOptParam {
pub size: usize,
}
pub struct SceKernelCallbackInfo {
pub size: usize,
pub name: [u8; 32usize],
pub thread_id: SceUid,
pub callback: SceKernelCallbackFunction,
pub common: *mut c_void,
pub notify_count: i32,
pub notify_arg: i32,
}
pub struct UsbCamSetupStillParam {
pub size: i32,
pub resolution: UsbCamResolution,
pub jpeg_size: i32,
pub reverse_flags: i32,
pub delay: UsbCamDelay,
pub comp_level: i32,
}
pub struct UsbCamSetupStillExParam {
pub size: i32,
pub unk: u32,
pub resolution: UsbCamResolutionEx,
pub jpeg_size: i32,
pub comp_level: i32,
pub unk2: u32,
pub unk3: u32,
pub flip: i32,
pub mirror: i32,
pub delay: UsbCamDelay,
pub unk4: [u32; 5usize],
}
pub struct UsbCamSetupVideoParam {
pub size: i32,
pub resolution: UsbCamResolution,
pub framerate: UsbCamFrameRate,
pub white_balance: UsbCamWb,
pub saturation: i32,
pub brightness: i32,
pub contrast: i32,
pub sharpness: i32,
pub effect_mode: UsbCamEffectMode,
pub frame_size: i32,
pub unk: u32,
pub evl_evel: UsbCamEvLevel,
}
pub struct UsbCamSetupVideoExParam {
pub size: i32,
pub unk: u32,
pub resolution: UsbCamResolutionEx,
pub framerate: UsbCamFrameRate,
pub unk2: u32,
pub unk3: u32,
pub white_balance: UsbCamWb,
pub saturation: i32,
pub brightness: i32,
pub contrast: i32,
pub sharpness: i32,
pub unk4: u32,
pub unk5: u32,
pub unk6: [u32; 3usize],
pub effect_mode: UsbCamEffectMode,
pub unk7: u32,
pub unk8: u32,
pub unk9: u32,
pub unk10: u32,
pub unk11: u32,
pub frame_size: i32,
pub unk12: u32,
pub ev_level: UsbCamEvLevel,
}
pub struct ScePspDateTime {
pub year: u16,
pub month: u16,
pub day: u16,
pub hour: u16,
pub minutes: u16,
pub seconds: u16,
pub microseconds: u32,
}
pub struct SceIoStat {
pub st_mode: i32,
pub st_attr: i32,
pub st_size: i64,
pub st_ctime: ScePspDateTime,
pub st_atime: ScePspDateTime,
pub st_mtime: ScePspDateTime,
pub st_private: [u32; 6usize],
}
pub struct UmdInfo {
pub size: u32,
pub type_: UmdType,
}
pub struct SceMpegRingbuffer {
pub packets: i32,
pub unk0: u32,
pub unk1: u32,
pub unk2: u32,
pub unk3: u32,
pub data: *mut c_void,
pub callback: SceMpegRingbufferCb,
pub cb_param: *mut c_void,
pub unk4: u32,
pub unk5: u32,
pub sce_mpeg: *mut c_void,
}
pub struct SceMpegAu {
pub pts_msb: u32,
pub pts: u32,
pub dts_msb: u32,
pub dts: u32,
pub es_buffer: u32,
pub au_size: u32,
}
pub struct SceMpegAvcMode {
pub unk0: i32,
pub pixel_format: super::DisplayPixelFormat,
}
#[repr(align(64))]
pub struct SceMpegLLI {
pub src: *mut c_void,
pub dst: *mut c_void,
pub next: *mut c_void,
pub size: i32,
}
#[repr(align(64))]
pub struct SceMpegYCrCbBuffer {
pub frame_buffer_height16: i32,
pub frame_buffer_width16: i32,
pub unknown: i32,
pub unknown2: i32,
pub y_buffer: *mut c_void,
pub y_buffer2: *mut c_void,
pub cr_buffer: *mut c_void,
pub cb_buffer: *mut c_void,
pub cr_buffer2: *mut c_void,
pub cb_buffer2: *mut c_void,
pub frame_height: i32,
pub frame_width: i32,
pub frame_buffer_width: i32,
pub unknown3: [i32; 11usize],
}
pub struct ScePspSRect {
pub x: i16,
pub y: i16,
pub w: i16,
pub h: i16,
}
pub struct ScePspIRect {
pub x: i32,
pub y: i32,
pub w: i32,
pub h: i32,
}
pub struct ScePspL64Rect {
pub x: u64,
pub y: u64,
pub w: u64,
pub h: u64,
}
pub struct ScePspSVector2 {
pub x: i16,
pub y: i16,
}
pub struct ScePspIVector2 {
pub x: i32,
pub y: i32,
}
pub struct ScePspL64Vector2 {
pub x: u64,
pub y: u64,
}
pub struct ScePspSVector3 {
pub x: i16,
pub y: i16,
pub z: i16,
}
pub struct ScePspIVector3 {
pub x: i32,
pub y: i32,
pub z: i32,
}
pub struct ScePspL64Vector3 {
pub x: u64,
pub y: u64,
pub z: u64,
}
pub struct ScePspSVector4 {
pub x: i16,
pub y: i16,
pub z: i16,
pub w: i16,
}
pub struct ScePspIVector4 {
pub x: i32,
pub y: i32,
pub z: i32,
pub w: i32,
}
pub struct ScePspL64Vector4 {
pub x: u64,
pub y: u64,
pub z: u64,
pub w: u64,
}
pub struct ScePspIMatrix2 {
pub x: ScePspIVector2,
pub y: ScePspIVector2,
}
pub struct ScePspIMatrix3 {
pub x: ScePspIVector3,
pub y: ScePspIVector3,
pub z: ScePspIVector3,
}
#[repr(align(16))]
pub struct ScePspIMatrix4 {
pub x: ScePspIVector4,
pub y: ScePspIVector4,
pub z: ScePspIVector4,
pub w: ScePspIVector4,
}
pub struct ScePspIMatrix4Unaligned {
pub x: ScePspIVector4,
pub y: ScePspIVector4,
pub z: ScePspIVector4,
pub w: ScePspIVector4,
}
pub struct SceMp3InitArg {
pub mp3_stream_start: u32,
pub unk1: u32,
pub mp3_stream_end: u32,
pub unk2: u32,
pub mp3_buf: *mut c_void,
pub mp3_buf_size: i32,
pub pcm_buf: *mut c_void,
pub pcm_buf_size: i32,
}
pub struct OpenPSID {
pub data: [u8; 16usize],
}
pub struct UtilityDialogCommon {
pub size: u32,
pub language: SystemParamLanguage,
pub button_accept: UtilityDialogButtonAccept,
pub graphics_thread: i32,
pub access_thread: i32,
pub font_thread: i32,
pub sound_thread: i32,
pub result: i32,
pub reserved: [i32; 4usize],
}
pub struct UtilityNetconfAdhoc {
pub name: [u8; 8usize],
pub timeout: u32,
}
pub struct UtilityNetconfData {
pub base: UtilityDialogCommon,
pub action: UtilityNetconfAction,
pub adhocparam: *mut UtilityNetconfAdhoc,
pub hotspot: i32,
pub hotspot_connected: i32,
pub wifisp: i32,
}
pub struct UtilitySavedataFileData {
pub buf: *mut c_void,
pub buf_size: usize,
pub size: usize,
pub unknown: i32,
}
pub struct UtilitySavedataListSaveNewData {
pub icon0: UtilitySavedataFileData,
pub title: *mut u8,
}
pub struct UtilityGameSharingParams {
pub base: UtilityDialogCommon,
pub unknown1: i32,
pub unknown2: i32,
pub name: [u8; 8usize],
pub unknown3: i32,
pub unknown4: i32,
pub unknown5: i32,
pub result: i32,
pub filepath: *mut u8,
pub mode: UtilityGameSharingMode,
pub datatype: UtilityGameSharingDataType,
pub data: *mut c_void,
pub datasize: u32,
}
pub struct UtilityHtmlViewerParam {
pub base: UtilityDialogCommon,
pub memaddr: *mut c_void,
pub memsize: u32,
pub unknown1: i32,
pub unknown2: i32,
pub initialurl: *mut u8,
pub numtabs: u32,
pub interfacemode: UtilityHtmlViewerInterfaceMode,
pub options: i32,
pub dldirname: *mut u8,
pub dlfilename: *mut u8,
pub uldirname: *mut u8,
pub ulfilename: *mut u8,
pub cookiemode: UtilityHtmlViewerCookieMode,
pub unknown3: u32,
pub homeurl: *mut u8,
pub textsize: UtilityHtmlViewerTextSize,
pub displaymode: UtilityHtmlViewerDisplayMode,
pub connectmode: UtilityHtmlViewerConnectMode,
pub disconnectmode: UtilityHtmlViewerDisconnectMode,
pub memused: u32,
pub unknown4: [i32; 10usize],
}
pub struct SceUtilityOskData {
pub unk_00: i32,
pub unk_04: i32,
pub language: SceUtilityOskInputLanguage,
pub unk_12: i32,
pub inputtype: SceUtilityOskInputType,
pub lines: i32,
pub unk_24: i32,
pub desc: *mut u16,
pub intext: *mut u16,
pub outtextlength: i32,
pub outtext: *mut u16,
pub result: SceUtilityOskResult,
pub outtextlimit: i32,
}
pub struct SceUtilityOskParams {
pub base: UtilityDialogCommon,
pub datacount: i32,
pub data: *mut SceUtilityOskData,
pub state: SceUtilityOskState,
pub unk_60: i32,
}
pub struct SceNetMallocStat {
pub pool: i32,
pub maximum: i32,
pub free: i32,
}
pub struct SceNetAdhocctlAdhocId {
pub unknown: i32,
pub adhoc_id: [u8; 9usize],
pub unk: [u8; 3usize],
}
pub struct SceNetAdhocctlScanInfo {
pub next: *mut SceNetAdhocctlScanInfo,
pub channel: i32,
pub name: [u8; 8usize],
pub bssid: [u8; 6usize],
pub unknown: [u8; 2usize],
pub unknown2: i32,
}
pub struct SceNetAdhocctlGameModeInfo {
pub count: i32,
pub macs: [[u8; 6usize]; 16usize],
}
pub struct SceNetAdhocPtpStat {
pub next: *mut SceNetAdhocPtpStat,
pub ptp_id: i32,
pub mac: [u8; 6usize],
pub peermac: [u8; 6usize],
pub port: u16,
pub peerport: u16,
pub sent_data: u32,
pub rcvd_data: u32,
pub state: ScePspnetAdhocPtpState,
}
pub struct SceNetAdhocPdpStat {
pub next: *mut SceNetAdhocPdpStat,
pub pdp_id: i32,
pub mac: [u8; 6usize],
pub port: u16,
pub rcvd_data: u32,
}
pub struct AdhocPoolStat {
pub size: i32,
pub maxsize: i32,
pub freesize: i32,
}
}
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
pub struct GeContext {
pub context: [u32; 512],
}
#[allow(missing_debug_implementations)]
pub struct SceKernelUtilsSha1Context {
pub h: [u32; 5usize],
pub us_remains: u16,
pub us_computed: u16,
pub ull_total_len: u64,
pub buf: [u8; 64usize],
}
#[allow(missing_debug_implementations)]
pub struct SceKernelUtilsMt19937Context {
pub count: u32,
pub state: [u32; 624usize],
}
#[allow(missing_debug_implementations)]
pub struct SceKernelUtilsMd5Context {
pub h: [u32; 4usize],
pub pad: u32,
pub us_remains: u16,
pub us_computed: u16,
pub ull_total_len: u64,
pub buf: [u8; 64usize],
}
#[allow(missing_debug_implementations)]
pub struct SceIoDirent {
pub d_stat: SceIoStat,
pub d_name: [u8; 256usize],
pub d_private: *mut c_void,
pub dummy: i32,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFRect {
pub x: f32,
pub y: f32,
pub w: f32,
pub h: f32,
}
#[repr(align(16))]
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFVector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[repr(align(16))]
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFVector4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFVector4Unaligned {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFVector2 {
pub x: f32,
pub y: f32,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFMatrix2 {
pub x: ScePspFVector2,
pub y: ScePspFVector2,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub struct ScePspFMatrix3 {
pub x: ScePspFVector3,
pub y: ScePspFVector3,
pub z: ScePspFVector3,
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
#[repr(align(16))]
pub struct ScePspFMatrix4 {
pub x: ScePspFVector4,
pub y: ScePspFVector4,
pub z: ScePspFVector4,
pub w: ScePspFVector4,
}
#[allow(missing_debug_implementations)]
pub struct ScePspFMatrix4Unaligned {
pub x: ScePspFVector4,
pub y: ScePspFVector4,
pub z: ScePspFVector4,
pub w: ScePspFVector4,
}
#[allow(missing_debug_implementations)]
pub union ScePspVector3 {
pub fv: ScePspFVector3,
pub iv: ScePspIVector3,
pub f: [f32; 3usize],
pub i: [i32; 3usize],
}
#[allow(missing_debug_implementations)]
pub union ScePspVector4 {
pub fv: ScePspFVector4,
pub iv: ScePspIVector4,
pub qw: u128,
pub f: [f32; 4usize],
pub i: [i32; 4usize],
}
#[allow(missing_debug_implementations)]
pub union ScePspMatrix2 {
pub fm: ScePspFMatrix2,
pub im: ScePspIMatrix2,
pub fv: [ScePspFVector2; 2usize],
pub iv: [ScePspIVector2; 2usize],
pub v: [ScePspVector2; 2usize],
pub f: [[f32; 2usize]; 2usize],
pub i: [[i32; 2usize]; 2usize],
}
#[allow(missing_debug_implementations)]
pub union ScePspMatrix3 {
pub fm: ScePspFMatrix3,
pub im: ScePspIMatrix3,
pub fv: [ScePspFVector3; 3usize],
pub iv: [ScePspIVector3; 3usize],
pub v: [ScePspVector3; 3usize],
pub f: [[f32; 3usize]; 3usize],
pub i: [[i32; 3usize]; 3usize],
}
#[allow(missing_debug_implementations)]
pub union ScePspVector2 {
pub fv: ScePspFVector2,
pub iv: ScePspIVector2,
pub f: [f32; 2usize],
pub i: [i32; 2usize],
}
#[allow(missing_debug_implementations)]
pub union ScePspMatrix4 {
pub fm: ScePspFMatrix4,
pub im: ScePspIMatrix4,
pub fv: [ScePspFVector4; 4usize],
pub iv: [ScePspIVector4; 4usize],
pub v: [ScePspVector4; 4usize],
pub f: [[f32; 4usize]; 4usize],
pub i: [[i32; 4usize]; 4usize],
}
#[allow(missing_debug_implementations)]
pub struct Key {
pub key_type: KeyType,
pub name: [u8; 256usize],
pub name_len: u32,
pub unk2: u32,
pub unk3: u32,
}
#[allow(missing_debug_implementations)]
pub struct UtilityMsgDialogParams {
pub base: UtilityDialogCommon,
pub unknown: i32,
pub mode: UtilityMsgDialogMode,
pub error_value: u32,
pub message: [u8; 512usize],
pub options: i32,
pub button_pressed: UtilityMsgDialogPressed,
}
#[allow(missing_debug_implementations)]
pub union UtilityNetData {
pub as_uint: u32,
pub as_string: [u8; 128usize],
}
#[allow(missing_debug_implementations)]
pub struct UtilitySavedataSFOParam {
pub title: [u8; 128usize],
pub savedata_title: [u8; 128usize],
pub detail: [u8; 1024usize],
pub parental_level: u8,
pub unknown: [u8; 3usize],
}
#[allow(missing_debug_implementations)]
pub struct SceUtilitySavedataParam {
pub base: UtilityDialogCommon,
pub mode: UtilitySavedataMode,
pub unknown1: i32,
pub overwrite: i32,
pub game_name: [u8; 13usize],
pub reserved: [u8; 3usize],
pub save_name: [u8; 20usize],
pub save_name_list: *mut [u8; 20usize],
pub file_name: [u8; 13usize],
pub reserved1: [u8; 3usize],
pub data_buf: *mut c_void,
pub data_buf_size: usize,
pub data_size: usize,
pub sfo_param: UtilitySavedataSFOParam,
pub icon0_file_data: UtilitySavedataFileData,
pub icon1_file_data: UtilitySavedataFileData,
pub pic1_file_data: UtilitySavedataFileData,
pub snd0_file_data: UtilitySavedataFileData,
pub new_data: *mut UtilitySavedataListSaveNewData,
pub focus: UtilitySavedataFocus,
pub unknown2: [i32; 4usize],
pub key: [u8; 16],
pub unknown3: [u8; 20],
}
#[allow(missing_debug_implementations)]
pub struct SceNetAdhocctlPeerInfo {
pub next: *mut SceNetAdhocctlPeerInfo,
pub nickname: [u8; 128usize],
pub mac: [u8; 6usize],
pub unknown: [u8; 6usize],
pub timestamp: u32,
}
#[allow(missing_debug_implementations)]
pub struct SceNetAdhocctlParams {
pub channel: i32,
pub name: [u8; 8usize],
pub bssid: [u8; 6usize],
pub nickname: [u8; 128usize],
}
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub union SceNetApctlInfo {
pub name: [u8; 64usize],
pub bssid: [u8; 6usize],
pub ssid: [u8; 32usize],
pub ssid_length: u32,
pub security_type: u32,
pub strength: u8,
pub channel: u8,
pub power_save: u8,
pub ip: [u8; 16usize],
pub sub_net_mask: [u8; 16usize],
pub gateway: [u8; 16usize],
pub primary_dns: [u8; 16usize],
pub secondary_dns: [u8; 16usize],
pub use_proxy: u32,
pub proxy_url: [u8; 128usize],
pub proxy_port: u16,
pub eap_type: u32,
pub start_browser: u32,
pub wifisp: u32,
}
}
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
pub const AUDIO_VOLUME_MAX: u32 = 0x8000;
pub const AUDIO_CHANNEL_MAX: u32 = 8;
pub const AUDIO_NEXT_CHANNEL: i32 = -1;
pub const AUDIO_SAMPLE_MIN: u32 = 64;
pub const AUDIO_SAMPLE_MAX: u32 = 65472;
pub const PSP_CTRL_SELECT: i32 = 0x000001;
pub const PSP_CTRL_START: i32 = 0x000008;
pub const PSP_CTRL_UP: i32 = 0x000010;
pub const PSP_CTRL_RIGHT: i32 = 0x000020;
pub const PSP_CTRL_DOWN: i32 = 0x000040;
pub const PSP_CTRL_LEFT: i32 = 0x000080;
pub const PSP_CTRL_LTRIGGER: i32 = 0x000100;
pub const PSP_CTRL_RTRIGGER: i32 = 0x000200;
pub const PSP_CTRL_TRIANGLE: i32 = 0x001000;
pub const PSP_CTRL_CIRCLE: i32 = 0x002000;
pub const PSP_CTRL_CROSS: i32 = 0x004000;
pub const PSP_CTRL_SQUARE: i32 = 0x008000;
pub const PSP_CTRL_HOME: i32 = 0x010000;
pub const PSP_CTRL_HOLD: i32 = 0x020000;
pub const PSP_CTRL_NOTE: i32 = 0x800000;
pub const PSP_CTRL_SCREEN: i32 = 0x400000;
pub const PSP_CTRL_VOLUP: i32 = 0x100000;
pub const PSP_CTRL_VOLDOWN: i32 = 0x200000;
pub const PSP_CTRL_WLAN_UP: i32 = 0x040000;
pub const PSP_CTRL_REMOTE: i32 = 0x080000;
pub const PSP_CTRL_DISC: i32 = 0x1000000;
pub const PSP_CTRL_MS: i32 = 0x2000000;
pub const USB_CAM_PID: i32 = 0x282;
pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver";
pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver";
pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver";
pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver";
pub const ACTIVATED: i32 = 0x200;
pub const CONNECTED: i32 = 0x020;
pub const ESTABLISHED: i32 = 0x002;
pub const USB_CAM_FLIP: i32 = 1;
pub const USB_CAM_MIRROR: i32 = 0x100;
pub const THREAD_ATTR_VFPU: i32 = 0x00004000;
pub const THREAD_ATTR_USER: i32 = 0x80000000;
pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000;
pub const THREAD_ATTR_VSH: i32 = 0xc0000000;
pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000;
pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000;
pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000;
pub const EVENT_WAIT_MULTIPLE: i32 = 0x200;
pub const EVENT_WAIT_AND: i32 = 0;
pub const EVENT_WAIT_OR: i32 = 1;
pub const EVENT_WAIT_CLEAR: i32 = 0x20;
pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000;
pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000;
pub const POWER_INFO_STANDBY: i32 = 0x00080000;
pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000;
pub const POWER_INFO_RESUMING: i32 = 0x00020000;
pub const POWER_INFO_SUSPENDING: i32 = 0x00010000;
pub const POWER_INFO_AC_POWER: i32 = 0x00001000;
pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100;
pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080;
pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007;
pub const FIO_S_IFLNK: i32 = 0x4000;
pub const FIO_S_IFDIR: i32 = 0x1000;
pub const FIO_S_IFREG: i32 = 0x2000;
pub const FIO_S_ISUID: i32 = 0x0800;
pub const FIO_S_ISGID: i32 = 0x0400;
pub const FIO_S_ISVTX: i32 = 0x0200;
pub const FIO_S_IRUSR: i32 = 0x0100;
pub const FIO_S_IWUSR: i32 = 0x0080;
pub const FIO_S_IXUSR: i32 = 0x0040;
pub const FIO_S_IRGRP: i32 = 0x0020;
pub const FIO_S_IWGRP: i32 = 0x0010;
pub const FIO_S_IXGRP: i32 = 0x0008;
pub const FIO_S_IROTH: i32 = 0x0004;
pub const FIO_S_IWOTH: i32 = 0x0002;
pub const FIO_S_IXOTH: i32 = 0x0001;
pub const FIO_SO_IFLNK: i32 = 0x0008;
pub const FIO_SO_IFDIR: i32 = 0x0010;
pub const FIO_SO_IFREG: i32 = 0x0020;
pub const FIO_SO_IROTH: i32 = 0x0004;
pub const FIO_SO_IWOTH: i32 = 0x0002;
pub const FIO_SO_IXOTH: i32 = 0x0001;
pub const PSP_O_RD_ONLY: i32 = 0x0001;
pub const PSP_O_WR_ONLY: i32 = 0x0002;
pub const PSP_O_RD_WR: i32 = 0x0003;
pub const PSP_O_NBLOCK: i32 = 0x0004;
pub const PSP_O_DIR: i32 = 0x0008;
pub const PSP_O_APPEND: i32 = 0x0100;
pub const PSP_O_CREAT: i32 = 0x0200;
pub const PSP_O_TRUNC: i32 = 0x0400;
pub const PSP_O_EXCL: i32 = 0x0800;
pub const PSP_O_NO_WAIT: i32 = 0x8000;
pub const UMD_NOT_PRESENT: i32 = 0x01;
pub const UMD_PRESENT: i32 = 0x02;
pub const UMD_CHANGED: i32 = 0x04;
pub const UMD_INITING: i32 = 0x08;
pub const UMD_INITED: i32 = 0x10;
pub const UMD_READY: i32 = 0x20;
pub const PLAY_PAUSE: i32 = 0x1;
pub const FORWARD: i32 = 0x4;
pub const BACK: i32 = 0x8;
pub const VOL_UP: i32 = 0x10;
pub const VOL_DOWN: i32 = 0x20;
pub const HOLD: i32 = 0x80;
pub const GU_PI: f32 = 3.141593;
pub const GU_TEXTURE_8BIT: i32 = 1;
pub const GU_TEXTURE_16BIT: i32 = 2;
pub const GU_TEXTURE_32BITF: i32 = 3;
pub const GU_COLOR_5650: i32 = 4 << 2;
pub const GU_COLOR_5551: i32 = 5 << 2;
pub const GU_COLOR_4444: i32 = 6 << 2;
pub const GU_COLOR_8888: i32 = 7 << 2;
pub const GU_NORMAL_8BIT: i32 = 1 << 5;
pub const GU_NORMAL_16BIT: i32 = 2 << 5;
pub const GU_NORMAL_32BITF: i32 = 3 << 5;
pub const GU_VERTEX_8BIT: i32 = 1 << 7;
pub const GU_VERTEX_16BIT: i32 = 2 << 7;
pub const GU_VERTEX_32BITF: i32 = 3 << 7;
pub const GU_WEIGHT_8BIT: i32 = 1 << 9;
pub const GU_WEIGHT_16BIT: i32 = 2 << 9;
pub const GU_WEIGHT_32BITF: i32 = 3 << 9;
pub const GU_INDEX_8BIT: i32 = 1 << 11;
pub const GU_INDEX_16BIT: i32 = 2 << 11;
pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32;
pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32;
pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32;
pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32;
pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32;
pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32;
pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32;
pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32;
pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32;
pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32;
pub const GU_TRANSFORM_2D: i32 = 1 << 23;
pub const GU_TRANSFORM_3D: i32 = 0;
pub const GU_COLOR_BUFFER_BIT: i32 = 1;
pub const GU_STENCIL_BUFFER_BIT: i32 = 2;
pub const GU_DEPTH_BUFFER_BIT: i32 = 4;
pub const GU_FAST_CLEAR_BIT: i32 = 16;
pub const GU_AMBIENT: i32 = 1;
pub const GU_DIFFUSE: i32 = 2;
pub const GU_SPECULAR: i32 = 4;
pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8;
pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system";
pub const REG_KEYNAME_SIZE: u32 = 27;
pub const UTILITY_MSGDIALOG_ERROR: i32 = 0;
pub const UTILITY_MSGDIALOG_TEXT: i32 = 1;
pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10;
pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100;
pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001;
pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002;
pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004;
pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008;
pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010;
pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020;
pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000040;
pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080;
pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100;
pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200;
pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400;
pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800;
extern "C" {
pub fn sceAudioChReserve(channel: i32, sample_count: i32, format: AudioFormat) -> i32;
pub fn sceAudioChRelease(channel: i32) -> i32;
pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioOutputBlocking(channel: i32, vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioOutputPanned(
channel: i32,
left_vol: i32,
right_vol: i32,
buf: *mut c_void,
) -> i32;
pub fn sceAudioOutputPannedBlocking(
channel: i32,
left_vol: i32,
right_vol: i32,
buf: *mut c_void,
) -> i32;
pub fn sceAudioGetChannelRestLen(channel: i32) -> i32;
pub fn sceAudioGetChannelRestLength(channel: i32) -> i32;
pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32;
pub fn sceAudioChangeChannelConfig(channel: i32, format: AudioFormat) -> i32;
pub fn sceAudioChangeChannelVolume(channel: i32, left_vol: i32, right_vol: i32) -> i32;
pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32;
pub fn sceAudioOutput2Release() -> i32;
pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32;
pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioOutput2GetRestSample() -> i32;
pub fn sceAudioSRCChReserve(
sample_count: i32,
freq: AudioOutputFrequency,
channels: i32,
) -> i32;
pub fn sceAudioSRCChRelease() -> i32;
pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32;
pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32;
pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32;
pub fn sceAudioInputBlocking(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
pub fn sceAudioInput(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void);
pub fn sceAudioGetInputLength() -> i32;
pub fn sceAudioWaitInputEnd() -> i32;
pub fn sceAudioPollInputEnd() -> i32;
pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32;
pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32;
pub fn sceAtracDecodeData(
atrac_id: i32,
out_samples: *mut u16,
out_n: *mut i32,
out_end: *mut i32,
out_remain_frame: *mut i32,
) -> i32;
pub fn sceAtracGetRemainFrame(atrac_id: i32, out_remain_frame: *mut i32) -> i32;
pub fn sceAtracGetStreamDataInfo(
atrac_id: i32,
write_pointer: *mut *mut u8,
available_bytes: *mut u32,
read_offset: *mut u32,
) -> i32;
pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32;
pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32;
pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32;
pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32;
pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32;
pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32;
pub fn sceAtracGetBufferInfoForReseting(
atrac_id: i32,
ui_sample: u32,
pbuffer_info: *mut Atrac3BufferInfo,
) -> i32;
pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32;
pub fn sceAtracGetInternalErrorInfo(atrac_id: i32, pi_result: *mut i32) -> i32;
pub fn sceAtracGetLoopStatus(
atrac_id: i32,
pi_loop_num: *mut i32,
pui_loop_status: *mut u32,
) -> i32;
pub fn sceAtracGetNextDecodePosition(atrac_id: i32, pui_sample_position: *mut u32) -> i32;
pub fn sceAtracGetSecondBufferInfo(
atrac_id: i32,
pui_position: *mut u32,
pui_data_byte: *mut u32,
) -> i32;
pub fn sceAtracGetSoundSample(
atrac_id: i32,
pi_end_sample: *mut i32,
pi_loop_start_sample: *mut i32,
pi_loop_end_sample: *mut i32,
) -> i32;
pub fn sceAtracResetPlayPosition(
atrac_id: i32,
ui_sample: u32,
ui_write_byte_first_buf: u32,
ui_write_byte_second_buf: u32,
) -> i32;
pub fn sceAtracSetData(atrac_id: i32, puc_buffer_addr: *mut u8, ui_buffer_byte: u32) -> i32;
pub fn sceAtracSetHalfwayBuffer(
atrac_id: i32,
puc_buffer_addr: *mut u8,
ui_read_byte: u32,
ui_buffer_byte: u32,
) -> i32;
pub fn sceAtracSetHalfwayBufferAndGetID(
puc_buffer_addr: *mut u8,
ui_read_byte: u32,
ui_buffer_byte: u32,
) -> i32;
pub fn sceAtracSetSecondBuffer(
atrac_id: i32,
puc_second_buffer_addr: *mut u8,
ui_second_buffer_byte: u32,
) -> i32;
pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32;
pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32;
pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32;
pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32;
pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32;
pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32;
pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32;
pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32;
pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) -> i32;
pub fn sceCtrlGetIdleCancelThreshold(idlereset: *mut i32, idleback: *mut i32) -> i32;
pub fn sceDisplaySetMode(mode: DisplayMode, width: usize, height: usize) -> u32;
pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32, pheight: *mut i32) -> i32;
pub fn sceDisplaySetFrameBuf(
top_addr: *const u8,
buffer_width: usize,
pixel_format: DisplayPixelFormat,
sync: DisplaySetBufSync,
) -> u32;
pub fn sceDisplayGetFrameBuf(
top_addr: *mut *mut c_void,
buffer_width: *mut usize,
pixel_format: *mut DisplayPixelFormat,
sync: DisplaySetBufSync,
) -> i32;
pub fn sceDisplayGetVcount() -> u32;
pub fn sceDisplayWaitVblank() -> i32;
pub fn sceDisplayWaitVblankCB() -> i32;
pub fn sceDisplayWaitVblankStart() -> i32;
pub fn sceDisplayWaitVblankStartCB() -> i32;
pub fn sceDisplayGetAccumulatedHcount() -> i32;
pub fn sceDisplayGetCurrentHcount() -> i32;
pub fn sceDisplayGetFramePerSec() -> f32;
pub fn sceDisplayIsForeground() -> i32;
pub fn sceDisplayIsVblank() -> i32;
pub fn sceGeEdramGetSize() -> u32;
pub fn sceGeEdramGetAddr() -> *mut u8;
pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32;
pub fn sceGeGetCmd(cmd: i32) -> u32;
pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32;
pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32;
pub fn sceGeSaveContext(context: *mut GeContext) -> i32;
pub fn sceGeRestoreContext(context: *const GeContext) -> i32;
pub fn sceGeListEnQueue(
list: *const c_void,
stall: *mut c_void,
cbid: i32,
arg: *mut GeListArgs,
) -> i32;
pub fn sceGeListEnQueueHead(
list: *const c_void,
stall: *mut c_void,
cbid: i32,
arg: *mut GeListArgs,
) -> i32;
pub fn sceGeListDeQueue(qid: i32) -> i32;
pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32;
pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState;
pub fn sceGeDrawSync(sync_type: i32) -> GeListState;
pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32;
pub fn sceGeContinue() -> i32;
pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32;
pub fn sceGeUnsetCallback(cbid: i32) -> i32;
pub fn sceKernelExitGame();
pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32;
pub fn sceKernelLoadExec(file: *const u8, param: *mut SceKernelLoadExecParam) -> i32;
pub fn sceKernelAllocPartitionMemory(
partition: SceSysMemPartitionId,
name: *const u8,
type_: SceSysMemBlockTypes,
size: u32,
addr: *mut c_void,
) -> SceUid;
pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void;
pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32;
pub fn sceKernelTotalFreeMemSize() -> usize;
pub fn sceKernelMaxFreeMemSize() -> usize;
pub fn sceKernelDevkitVersion() -> u32;
pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32;
pub fn sceKernelGetCompiledSdkVersion() -> u32;
pub fn sceKernelLibcTime(t: *mut i32) -> i32;
pub fn sceKernelLibcClock() -> u32;
pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone) -> i32;
pub fn sceKernelDcacheWritebackAll();
pub fn sceKernelDcacheWritebackInvalidateAll();
pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32);
pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void, size: u32);
pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32);
pub fn sceKernelIcacheInvalidateAll();
pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32);
pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context, seed: u32) -> i32;
pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context) -> u32;
pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context) -> i32;
pub fn sceKernelUtilsMd5BlockUpdate(
ctx: *mut SceKernelUtilsMd5Context,
data: *mut u8,
size: u32,
) -> i32;
pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context, digest: *mut u8)
-> i32;
pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32;
pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context) -> i32;
pub fn sceKernelUtilsSha1BlockUpdate(
ctx: *mut SceKernelUtilsSha1Context,
data: *mut u8,
size: u32,
) -> i32;
pub fn sceKernelUtilsSha1BlockResult(
ctx: *mut SceKernelUtilsSha1Context,
digest: *mut u8,
) -> i32;
pub fn sceKernelRegisterSubIntrHandler(
int_no: i32,
no: i32,
handler: *mut c_void,
arg: *mut c_void,
) -> i32;
pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32;
pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32;
pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32;
pub fn QueryIntrHandlerInfo(
intr_code: SceUid,
sub_intr_code: SceUid,
data: *mut IntrHandlerOptionParam,
) -> i32;
pub fn sceKernelCpuSuspendIntr() -> u32;
pub fn sceKernelCpuResumeIntr(flags: u32);
pub fn sceKernelCpuResumeIntrWithSync(flags: u32);
pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32;
pub fn sceKernelIsCpuIntrEnable() -> i32;
pub fn sceKernelLoadModule(
path: *const u8,
flags: i32,
option: *mut SceKernelLMOption,
) -> SceUid;
pub fn sceKernelLoadModuleMs(
path: *const u8,
flags: i32,
option: *mut SceKernelLMOption,
) -> SceUid;
pub fn sceKernelLoadModuleByID(
fid: SceUid,
flags: i32,
option: *mut SceKernelLMOption,
) -> SceUid;
pub fn sceKernelLoadModuleBufferUsbWlan(
buf_size: usize,
buf: *mut c_void,
flags: i32,
option: *mut SceKernelLMOption,
) -> SceUid;
pub fn sceKernelStartModule(
mod_id: SceUid,
arg_size: usize,
argp: *mut c_void,
status: *mut i32,
option: *mut SceKernelSMOption,
) -> i32;
pub fn sceKernelStopModule(
mod_id: SceUid,
arg_size: usize,
argp: *mut c_void,
status: *mut i32,
option: *mut SceKernelSMOption,
) -> i32;
pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32;
pub fn sceKernelSelfStopUnloadModule(unknown: i32, arg_size: usize, argp: *mut c_void) -> i32;
pub fn sceKernelStopUnloadSelfModule(
arg_size: usize,
argp: *mut c_void,
status: *mut i32,
option: *mut SceKernelSMOption,
) -> i32;
pub fn sceKernelQueryModuleInfo(mod_id: SceUid, info: *mut SceKernelModuleInfo) -> i32;
pub fn sceKernelGetModuleIdList(
read_buf: *mut SceUid,
read_buf_size: i32,
id_count: *mut i32,
) -> i32;
pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32;
pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32;
pub fn sceKernelStdin() -> SceUid;
pub fn sceKernelStdout() -> SceUid;
pub fn sceKernelStderr() -> SceUid;
pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType;
pub fn sceKernelCreateThread(
name: *const u8,
entry: SceKernelThreadEntry,
init_priority: i32,
stack_size: i32,
attr: i32,
option: *mut SceKernelThreadOptParam,
) -> SceUid;
pub fn sceKernelDeleteThread(thid: SceUid) -> i32;
pub fn sceKernelStartThread(id: SceUid, arg_len: usize, arg_p: *mut c_void) -> i32;
pub fn sceKernelExitThread(status: i32) -> i32;
pub fn sceKernelExitDeleteThread(status: i32) -> i32;
pub fn sceKernelTerminateThread(thid: SceUid) -> i32;
pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32;
pub fn sceKernelSuspendDispatchThread() -> i32;
pub fn sceKernelResumeDispatchThread(state: i32) -> i32;
pub fn sceKernelSleepThread() -> i32;
pub fn sceKernelSleepThreadCB() -> i32;
pub fn sceKernelWakeupThread(thid: SceUid) -> i32;
pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32;
pub fn sceKernelSuspendThread(thid: SceUid) -> i32;
pub fn sceKernelResumeThread(thid: SceUid) -> i32;
pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32;
pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32;
pub fn sceKernelDelayThread(delay: u32) -> i32;
pub fn sceKernelDelayThreadCB(delay: u32) -> i32;
pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32;
pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock) -> i32;
pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32;
pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32;
pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32;
pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32;
pub fn sceKernelGetThreadId() -> i32;
pub fn sceKernelGetThreadCurrentPriority() -> i32;
pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32;
pub fn sceKernelCheckThreadStack() -> i32;
pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32;
pub fn sceKernelReferThreadStatus(thid: SceUid, info: *mut SceKernelThreadInfo) -> i32;
pub fn sceKernelReferThreadRunStatus(
thid: SceUid,
status: *mut SceKernelThreadRunStatus,
) -> i32;
pub fn sceKernelCreateSema(
name: *const u8,
attr: u32,
init_val: i32,
max_val: i32,
option: *mut SceKernelSemaOptParam,
) -> SceUid;
pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32;
pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32;
pub fn sceKernelWaitSema(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
pub fn sceKernelWaitSemaCB(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32;
pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32;
pub fn sceKernelReferSemaStatus(sema_id: SceUid, info: *mut SceKernelSemaInfo) -> i32;
pub fn sceKernelCreateEventFlag(
name: *const u8,
attr: i32,
bits: i32,
opt: *mut SceKernelEventFlagOptParam,
) -> SceUid;
pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32;
pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32;
pub fn sceKernelPollEventFlag(ev_id: SceUid, bits: u32, wait: i32, out_bits: *mut u32) -> i32;
pub fn sceKernelWaitEventFlag(
ev_id: SceUid,
bits: u32,
wait: i32,
out_bits: *mut u32,
timeout: *mut u32,
) -> i32;
pub fn sceKernelWaitEventFlagCB(
ev_id: SceUid,
bits: u32,
wait: i32,
out_bits: *mut u32,
timeout: *mut u32,
) -> i32;
pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32;
pub fn sceKernelReferEventFlagStatus(event: SceUid, status: *mut SceKernelEventFlagInfo)
-> i32;
pub fn sceKernelCreateMbx(
name: *const u8,
attr: u32,
option: *mut SceKernelMbxOptParam,
) -> SceUid;
pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32;
pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32;
pub fn sceKernelReceiveMbx(mbx_id: SceUid, message: *mut *mut c_void, timeout: *mut u32)
-> i32;
pub fn sceKernelReceiveMbxCB(
mbx_id: SceUid,
message: *mut *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) -> i32;
pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32;
pub fn sceKernelReferMbxStatus(mbx_id: SceUid, info: *mut SceKernelMbxInfo) -> i32;
pub fn sceKernelSetAlarm(
clock: u32,
handler: SceKernelAlarmHandler,
common: *mut c_void,
) -> SceUid;
pub fn sceKernelSetSysClockAlarm(
clock: *mut SceKernelSysClock,
handler: *mut SceKernelAlarmHandler,
common: *mut c_void,
) -> SceUid;
pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32;
pub fn sceKernelReferAlarmStatus(alarm_id: SceUid, info: *mut SceKernelAlarmInfo) -> i32;
pub fn sceKernelCreateCallback(
name: *const u8,
func: SceKernelCallbackFunction,
arg: *mut c_void,
) -> SceUid;
pub fn sceKernelReferCallbackStatus(cb: SceUid, status: *mut SceKernelCallbackInfo) -> i32;
pub fn sceKernelDeleteCallback(cb: SceUid) -> i32;
pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32;
pub fn sceKernelCancelCallback(cb: SceUid) -> i32;
pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32;
pub fn sceKernelCheckCallback() -> i32;
pub fn sceKernelGetThreadmanIdList(
type_: SceKernelIdListType,
read_buf: *mut SceUid,
read_buf_size: i32,
id_count: *mut i32,
) -> i32;
pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus) -> i32;
pub fn sceKernelCreateMsgPipe(
name: *const u8,
part: i32,
attr: i32,
unk1: *mut c_void,
opt: *mut c_void,
) -> SceUid;
pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32;
pub fn sceKernelSendMsgPipe(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelSendMsgPipeCB(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelTrySendMsgPipe(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
) -> i32;
pub fn sceKernelReceiveMsgPipe(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelReceiveMsgPipeCB(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelTryReceiveMsgPipe(
uid: SceUid,
message: *mut c_void,
size: u32,
unk1: i32,
unk2: *mut c_void,
) -> i32;
pub fn sceKernelCancelMsgPipe(uid: SceUid, send: *mut i32, recv: *mut i32) -> i32;
pub fn sceKernelReferMsgPipeStatus(uid: SceUid, info: *mut SceKernelMppInfo) -> i32;
pub fn sceKernelCreateVpl(
name: *const u8,
part: i32,
attr: i32,
size: u32,
opt: *mut SceKernelVplOptParam,
) -> SceUid;
pub fn sceKernelDeleteVpl(uid: SceUid) -> i32;
pub fn sceKernelAllocateVpl(
uid: SceUid,
size: u32,
data: *mut *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelAllocateVplCB(
uid: SceUid,
size: u32,
data: *mut *mut c_void,
timeout: *mut u32,
) -> i32;
pub fn sceKernelTryAllocateVpl(uid: SceUid, size: u32, data: *mut *mut c_void) -> i32;
pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32;
pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32;
pub fn sceKernelReferVplStatus(uid: SceUid, info: *mut SceKernelVplInfo) -> i32;
pub fn sceKernelCreateFpl(
name: *const u8,
part: i32,
attr: i32,
size: u32,
blocks: u32,
opt: *mut SceKernelFplOptParam,
) -> i32;
pub fn sceKernelDeleteFpl(uid: SceUid) -> i32;
pub fn sceKernelAllocateFpl(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
pub fn sceKernelAllocateFplCB(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32;
pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) -> i32;
pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32;
pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32;
pub fn sceKernelReferFplStatus(uid: SceUid, info: *mut SceKernelFplInfo) -> i32;
pub fn sceKernelUSec2SysClock(usec: u32, clock: *mut SceKernelSysClock) -> i32;
pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64;
pub fn sceKernelSysClock2USec(
clock: *mut SceKernelSysClock,
low: *mut u32,
high: *mut u32,
) -> i32;
pub fn sceKernelSysClock2USecWide(clock: i64, low: *mut u32, high: *mut u32) -> i32;
pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetSystemTimeWide() -> i64;
pub fn sceKernelGetSystemTimeLow() -> u32;
pub fn sceKernelCreateVTimer(name: *const u8, opt: *mut SceKernelVTimerOptParam) -> SceUid;
pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32;
pub fn sceKernelGetVTimerBase(uid: SceUid, base: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64;
pub fn sceKernelGetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64;
pub fn sceKernelSetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32;
pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64;
pub fn sceKernelStartVTimer(uid: SceUid) -> i32;
pub fn sceKernelStopVTimer(uid: SceUid) -> i32;
pub fn sceKernelSetVTimerHandler(
uid: SceUid,
time: *mut SceKernelSysClock,
handler: SceKernelVTimerHandler,
common: *mut c_void,
) -> i32;
pub fn sceKernelSetVTimerHandlerWide(
uid: SceUid,
time: i64,
handler: SceKernelVTimerHandlerWide,
common: *mut c_void,
) -> i32;
pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32;
pub fn sceKernelReferVTimerStatus(uid: SceUid, info: *mut SceKernelVTimerInfo) -> i32;
pub fn sceKernelRegisterThreadEventHandler(
name: *const u8,
thread_id: SceUid,
mask: i32,
handler: SceKernelThreadEventHandler,
common: *mut c_void,
) -> SceUid;
pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32;
pub fn sceKernelReferThreadEventHandlerStatus(
uid: SceUid,
info: *mut SceKernelThreadEventHandlerInfo,
) -> i32;
pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs;
pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs;
pub fn sceUsbStart(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
pub fn sceUsbStop(driver_name: *const u8, size: i32, args: *mut c_void) -> i32;
pub fn sceUsbActivate(pid: u32) -> i32;
pub fn sceUsbDeactivate(pid: u32) -> i32;
pub fn sceUsbGetState() -> i32;
pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32;
}
extern "C" {
pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32;
pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32;
pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32;
pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32;
pub fn sceUsbCamStillWaitInputEnd() -> i32;
pub fn sceUsbCamStillPollInputEnd() -> i32;
pub fn sceUsbCamStillCancelInput() -> i32;
pub fn sceUsbCamStillGetInputLength() -> i32;
pub fn sceUsbCamSetupVideo(
param: *mut UsbCamSetupVideoParam,
work_area: *mut c_void,
work_area_size: i32,
) -> i32;
pub fn sceUsbCamSetupVideoEx(
param: *mut UsbCamSetupVideoExParam,
work_area: *mut c_void,
work_area_size: i32,
) -> i32;
pub fn sceUsbCamStartVideo() -> i32;
pub fn sceUsbCamStopVideo() -> i32;
pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32;
pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32;
pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32;
pub fn sceUsbCamPollReadVideoFrameEnd() -> i32;
pub fn sceUsbCamGetReadVideoFrameSize() -> i32;
pub fn sceUsbCamSetSaturation(saturation: i32) -> i32;
pub fn sceUsbCamSetBrightness(brightness: i32) -> i32;
pub fn sceUsbCamSetContrast(contrast: i32) -> i32;
pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32;
pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32;
pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32;
pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32;
pub fn sceUsbCamSetZoom(zoom: i32) -> i32;
pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32;
pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
pub fn sceUsbCamGetImageEffectMode(effect_mode: *mut UsbCamEffectMode) -> i32;
pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32;
pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32;
pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32;
pub fn sceUsbCamGetAutoImageReverseState() -> i32;
pub fn sceUsbCamGetLensDirection() -> i32;
pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32;
pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32;
pub fn sceUsbstorBootSetCapacity(size: u32) -> i32;
pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32;
pub fn scePowerUnregisterCallback(slot: i32) -> i32;
pub fn scePowerIsPowerOnline() -> i32;
pub fn scePowerIsBatteryExist() -> i32;
pub fn scePowerIsBatteryCharging() -> i32;
pub fn scePowerGetBatteryChargingStatus() -> i32;
pub fn scePowerIsLowBattery() -> i32;
pub fn scePowerGetBatteryLifePercent() -> i32;
pub fn scePowerGetBatteryLifeTime() -> i32;
pub fn scePowerGetBatteryTemp() -> i32;
pub fn scePowerGetBatteryElec() -> i32;
pub fn scePowerGetBatteryVolt() -> i32;
pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32;
pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32;
pub fn scePowerGetCpuClockFrequency() -> i32;
pub fn scePowerGetCpuClockFrequencyInt() -> i32;
pub fn scePowerGetCpuClockFrequencyFloat() -> f32;
pub fn scePowerGetBusClockFrequency() -> i32;
pub fn scePowerGetBusClockFrequencyInt() -> i32;
pub fn scePowerGetBusClockFrequencyFloat() -> f32;
pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32, busfreq: i32) -> i32;
pub fn scePowerLock(unknown: i32) -> i32;
pub fn scePowerUnlock(unknown: i32) -> i32;
pub fn scePowerTick(t: PowerTick) -> i32;
pub fn scePowerGetIdleTimer() -> i32;
pub fn scePowerIdleTimerEnable(unknown: i32) -> i32;
pub fn scePowerIdleTimerDisable(unknown: i32) -> i32;
pub fn scePowerRequestStandby() -> i32;
pub fn scePowerRequestSuspend() -> i32;
pub fn sceWlanDevIsPowerOn() -> i32;
pub fn sceWlanGetSwitchState() -> i32;
pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32;
pub fn sceWlanDevAttach() -> i32;
pub fn sceWlanDevDetach() -> i32;
pub fn sceRtcGetTickResolution() -> u32;
pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32;
pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32;
pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32;
pub fn sceRtcConvertUtcToLocalTime(tick_utc: *const u64, tick_local: *mut u64) -> i32;
pub fn sceRtcConvertLocalTimeToUTC(tick_local: *const u64, tick_utc: *mut u64) -> i32;
pub fn sceRtcIsLeapYear(year: i32) -> i32;
pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32;
pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32;
pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32;
pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32;
pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32;
pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32;
pub fn sceRtcTickAddTicks(dest_tick: *mut u64, src_tick: *const u64, num_ticks: u64) -> i32;
pub fn sceRtcTickAddMicroseconds(dest_tick: *mut u64, src_tick: *const u64, num_ms: u64)
-> i32;
pub fn sceRtcTickAddSeconds(dest_tick: *mut u64, src_tick: *const u64, num_seconds: u64)
-> i32;
pub fn sceRtcTickAddMinutes(dest_tick: *mut u64, src_tick: *const u64, num_minutes: u64)
-> i32;
pub fn sceRtcTickAddHours(dest_tick: *mut u64, src_tick: *const u64, num_hours: u64) -> i32;
pub fn sceRtcTickAddDays(dest_tick: *mut u64, src_tick: *const u64, num_days: u64) -> i32;
pub fn sceRtcTickAddWeeks(dest_tick: *mut u64, src_tick: *const u64, num_weeks: u64) -> i32;
pub fn sceRtcTickAddMonths(dest_tick: *mut u64, src_tick: *const u64, num_months: u64) -> i32;
pub fn sceRtcTickAddYears(dest_tick: *mut u64, src_tick: *const u64, num_years: u64) -> i32;
pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32;
pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32;
pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32;
pub fn sceRtcGetTime64_t(date: *const ScePspDateTime, time: *mut u64) -> i32;
pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
pub fn sceRtcSetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
pub fn sceRtcGetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32;
pub fn sceRtcParseDateTime(dest_tick: *mut u64, date_string: *const u8) -> i32;
pub fn sceRtcFormatRFC3339(
psz_date_time: *mut char,
p_utc: *const u64,
time_zone_minutes: i32,
) -> i32;
pub fn sceRtcFormatRFC3339LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
pub fn sceRtcParseRFC3339(p_utc: *mut u64, psz_date_time: *const u8) -> i32;
pub fn sceRtcFormatRFC2822(
psz_date_time: *mut char,
p_utc: *const u64,
time_zone_minutes: i32,
) -> i32;
pub fn sceRtcFormatRFC2822LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32;
pub fn sceIoOpen(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
pub fn sceIoOpenAsync(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid;
pub fn sceIoClose(fd: SceUid) -> i32;
pub fn sceIoCloseAsync(fd: SceUid) -> i32;
pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32;
pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32;
pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32;
pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32;
pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64;
pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32;
pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
pub fn sceIoRemove(file: *const u8) -> i32;
pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32;
pub fn sceIoRmdir(path: *const u8) -> i32;
pub fn sceIoChdir(path: *const u8) -> i32;
pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32;
pub fn sceIoDopen(dirname: *const u8) -> SceUid;
pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32;
pub fn sceIoDclose(fd: SceUid) -> i32;
pub fn sceIoDevctl(
dev: *const u8,
cmd: u32,
indata: *mut c_void,
inlen: i32,
outdata: *mut c_void,
outlen: i32,
) -> i32;
pub fn sceIoAssign(
dev1: *const u8,
dev2: *const u8,
dev3: *const u8,
mode: IoAssignPerms,
unk1: *mut c_void,
unk2: i32,
) -> i32;
pub fn sceIoUnassign(dev: *const u8) -> i32;
pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32;
pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat, bits: i32) -> i32;
pub fn sceIoIoctl(
fd: SceUid,
cmd: u32,
indata: *mut c_void,
inlen: i32,
outdata: *mut c_void,
outlen: i32,
) -> i32;
pub fn sceIoIoctlAsync(
fd: SceUid,
cmd: u32,
indata: *mut c_void,
inlen: i32,
outdata: *mut c_void,
outlen: i32,
) -> i32;
pub fn sceIoSync(device: *const u8, unk: u32) -> i32;
pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32;
pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32;
pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32;
pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32;
pub fn sceIoCancel(fd: SceUid) -> i32;
pub fn sceIoGetDevType(fd: SceUid) -> i32;
pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32;
pub fn sceIoSetAsyncCallback(fd: SceUid, cb: SceUid, argp: *mut c_void) -> i32;
pub fn sceJpegInitMJpeg() -> i32;
pub fn sceJpegFinishMJpeg() -> i32;
pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32;
pub fn sceJpegDeleteMJpeg() -> i32;
pub fn sceJpegDecodeMJpeg(jpeg_buf: *mut u8, size: usize, rgba: *mut c_void, unk: u32) -> i32;
pub fn sceUmdCheckMedium() -> i32;
pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32;
pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32;
pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32;
pub fn sceUmdWaitDriveStat(state: i32) -> i32;
pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32;
pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32;
pub fn sceUmdCancelWaitDriveStat() -> i32;
pub fn sceUmdGetDriveStat() -> i32;
pub fn sceUmdGetErrorStat() -> i32;
pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32;
pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32;
pub fn sceUmdReplacePermit() -> i32;
pub fn sceUmdReplaceProhibit() -> i32;
pub fn sceMpegInit() -> i32;
pub fn sceMpegFinish();
pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32;
pub fn sceMpegRingbufferConstruct(
ringbuffer: *mut SceMpegRingbuffer,
packets: i32,
data: *mut c_void,
size: i32,
callback: SceMpegRingbufferCb,
cb_param: *mut c_void,
) -> i32;
pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer);
pub fn sceMpegRingbufferAvailableSize(ringbuffer: *mut SceMpegRingbuffer) -> i32;
pub fn sceMpegRingbufferPut(
ringbuffer: *mut SceMpegRingbuffer,
num_packets: i32,
available: i32,
) -> i32;
pub fn sceMpegQueryMemSize(unk: i32) -> i32;
pub fn sceMpegCreate(
handle: SceMpeg,
data: *mut c_void,
size: i32,
ringbuffer: *mut SceMpegRingbuffer,
frame_width: i32,
unk1: i32,
unk2: i32,
) -> i32;
pub fn sceMpegDelete(handle: SceMpeg);
pub fn sceMpegQueryStreamOffset(handle: SceMpeg, buffer: *mut c_void, offset: *mut i32) -> i32;
pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32;
pub fn sceMpegRegistStream(handle: SceMpeg, stream_id: i32, unk: i32) -> SceMpegStream;
pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream);
pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32;
pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void;
pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void);
pub fn sceMpegQueryAtracEsSize(handle: SceMpeg, es_size: *mut i32, out_size: *mut i32) -> i32;
pub fn sceMpegInitAu(handle: SceMpeg, es_buffer: *mut c_void, au: *mut SceMpegAu) -> i32;
pub fn sceMpegGetAvcAu(
handle: SceMpeg,
stream: SceMpegStream,
au: *mut SceMpegAu,
unk: *mut i32,
) -> i32;
pub fn sceMpegAvcDecodeMode(handle: SceMpeg, mode: *mut SceMpegAvcMode) -> i32;
pub fn sceMpegAvcDecode(
handle: SceMpeg,
au: *mut SceMpegAu,
iframe_width: i32,
buffer: *mut c_void,
init: *mut i32,
) -> i32;
pub fn sceMpegAvcDecodeStop(
handle: SceMpeg,
frame_width: i32,
buffer: *mut c_void,
status: *mut i32,
) -> i32;
pub fn sceMpegGetAtracAu(
handle: SceMpeg,
stream: SceMpegStream,
au: *mut SceMpegAu,
unk: *mut c_void,
) -> i32;
pub fn sceMpegAtracDecode(
handle: SceMpeg,
au: *mut SceMpegAu,
buffer: *mut c_void,
init: i32,
) -> i32;
pub fn sceMpegBaseYCrCbCopyVme(yuv_buffer: *mut c_void, buffer: *mut i32, type_: i32) -> i32;
pub fn sceMpegBaseCscInit(width: i32) -> i32;
pub fn sceMpegBaseCscVme(
rgb_buffer: *mut c_void,
rgb_buffer2: *mut c_void,
width: i32,
y_cr_cb_buffer: *mut SceMpegYCrCbBuffer,
) -> i32;
pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32;
pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32;
pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32;
pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32;
pub fn sceHprmIsHeadphoneExist() -> i32;
pub fn sceHprmIsRemoteExist() -> i32;
pub fn sceHprmIsMicrophoneExist() -> i32;
pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32);
pub fn sceGuDispBuffer(width: i32, height: i32, dispbp: *mut c_void, dispbw: i32);
pub fn sceGuDrawBuffer(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
pub fn sceGuDrawBufferList(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32);
pub fn sceGuDisplay(state: bool) -> bool;
pub fn sceGuDepthFunc(function: DepthFunc);
pub fn sceGuDepthMask(mask: i32);
pub fn sceGuDepthOffset(offset: i32);
pub fn sceGuDepthRange(near: i32, far: i32);
pub fn sceGuFog(near: f32, far: f32, color: u32);
pub fn sceGuInit();
pub fn sceGuTerm();
pub fn sceGuBreak(mode: i32);
pub fn sceGuContinue();
pub fn sceGuSetCallback(signal: GuCallbackId, callback: GuCallback) -> GuCallback;
pub fn sceGuSignal(behavior: SignalBehavior, signal: i32);
pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32);
pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32);
pub fn sceGuGetMemory(size: i32) -> *mut c_void;
pub fn sceGuStart(context_type: GuContextType, list: *mut c_void);
pub fn sceGuFinish() -> i32;
pub fn sceGuFinishId(id: u32) -> i32;
pub fn sceGuCallList(list: *const c_void);
pub fn sceGuCallMode(mode: i32);
pub fn sceGuCheckList() -> i32;
pub fn sceGuSendList(mode: GuQueueMode, list: *const c_void, context: *mut GeContext);
pub fn sceGuSwapBuffers() -> *mut c_void;
pub fn sceGuSync(mode: GuSyncMode, behavior: GuSyncBehavior) -> GeListState;
pub fn sceGuDrawArray(
prim: GuPrimitive,
vtype: i32,
count: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGuBeginObject(
vtype: i32,
count: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGuEndObject();
pub fn sceGuSetStatus(state: GuState, status: i32);
pub fn sceGuGetStatus(state: GuState) -> bool;
pub fn sceGuSetAllStatus(status: i32);
pub fn sceGuGetAllStatus() -> i32;
pub fn sceGuEnable(state: GuState);
pub fn sceGuDisable(state: GuState);
pub fn sceGuLight(light: i32, type_: LightType, components: i32, position: &ScePspFVector3);
pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32);
pub fn sceGuLightColor(light: i32, component: i32, color: u32);
pub fn sceGuLightMode(mode: LightMode);
pub fn sceGuLightSpot(light: i32, direction: &ScePspFVector3, exponent: f32, cutoff: f32);
pub fn sceGuClear(flags: i32);
pub fn sceGuClearColor(color: u32);
pub fn sceGuClearDepth(depth: u32);
pub fn sceGuClearStencil(stencil: u32);
pub fn sceGuPixelMask(mask: u32);
pub fn sceGuColor(color: u32);
pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32);
pub fn sceGuColorMaterial(components: i32);
pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32);
pub fn sceGuAmbient(color: u32);
pub fn sceGuAmbientColor(color: u32);
pub fn sceGuBlendFunc(op: BlendOp, src: BlendSrc, dest: BlendDst, src_fix: u32, dest_fix: u32);
pub fn sceGuMaterial(components: i32, color: u32);
pub fn sceGuModelColor(emissive: u32, ambient: u32, diffuse: u32, specular: u32);
pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32);
pub fn sceGuStencilOp(fail: StencilOperation, zfail: StencilOperation, zpass: StencilOperation);
pub fn sceGuSpecular(power: f32);
pub fn sceGuFrontFace(order: FrontFaceDirection);
pub fn sceGuLogicalOp(op: LogicalOperation);
pub fn sceGuSetDither(matrix: &ScePspIMatrix4);
pub fn sceGuShadeModel(mode: ShadingModel);
pub fn sceGuCopyImage(
psm: DisplayPixelFormat,
sx: i32,
sy: i32,
width: i32,
height: i32,
srcw: i32,
src: *mut c_void,
dx: i32,
dy: i32,
destw: i32,
dest: *mut c_void,
);
pub fn sceGuTexEnvColor(color: u32);
pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter);
pub fn sceGuTexFlush();
pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent);
pub fn sceGuTexImage(
mipmap: MipmapLevel,
width: i32,
height: i32,
tbw: i32,
tbp: *const c_void,
);
pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32);
pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32);
pub fn sceGuTexMode(tpsm: TexturePixelFormat, maxmips: i32, a2: i32, swizzle: i32);
pub fn sceGuTexOffset(u: f32, v: f32);
pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode);
pub fn sceGuTexScale(u: f32, v: f32);
pub fn sceGuTexSlope(slope: f32);
pub fn sceGuTexSync();
pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode);
pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void);
pub fn sceGuClutMode(cpsm: ClutPixelFormat, shift: u32, mask: u32, a3: u32);
pub fn sceGuOffset(x: u32, y: u32);
pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32);
pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32);
pub fn sceGuDrawBezier(
v_type: i32,
u_count: i32,
v_count: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32);
pub fn sceGuPatchFrontFace(a0: u32);
pub fn sceGuPatchPrim(prim: PatchPrimitive);
pub fn sceGuDrawSpline(
v_type: i32,
u_count: i32,
v_count: i32,
u_edge: i32,
v_edge: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4);
pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4);
pub fn sceGuMorphWeight(index: i32, weight: f32);
pub fn sceGuDrawArrayN(
primitive_type: GuPrimitive,
v_type: i32,
count: i32,
a3: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGumDrawArray(
prim: GuPrimitive,
v_type: i32,
count: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGumDrawArrayN(
prim: GuPrimitive,
v_type: i32,
count: i32,
a3: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGumDrawBezier(
v_type: i32,
u_count: i32,
v_count: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGumDrawSpline(
v_type: i32,
u_count: i32,
v_count: i32,
u_edge: i32,
v_edge: i32,
indices: *const c_void,
vertices: *const c_void,
);
pub fn sceGumFastInverse();
pub fn sceGumFullInverse();
pub fn sceGumLoadIdentity();
pub fn sceGumLoadMatrix(m: &ScePspFMatrix4);
pub fn sceGumLookAt(eye: &ScePspFVector3, center: &ScePspFVector3, up: &ScePspFVector3);
pub fn sceGumMatrixMode(mode: MatrixMode);
pub fn sceGumMultMatrix(m: &ScePspFMatrix4);
pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32);
pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
pub fn sceGumPopMatrix();
pub fn sceGumPushMatrix();
pub fn sceGumRotateX(angle: f32);
pub fn sceGumRotateY(angle: f32);
pub fn sceGumRotateZ(angle: f32);
pub fn sceGumRotateXYZ(v: &ScePspFVector3);
pub fn sceGumRotateZYX(v: &ScePspFVector3);
pub fn sceGumScale(v: &ScePspFVector3);
pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4);
pub fn sceGumTranslate(v: &ScePspFVector3);
pub fn sceGumUpdateMatrix();
pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32;
pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32;
pub fn sceMp3InitResource() -> i32;
pub fn sceMp3TermResource() -> i32;
pub fn sceMp3Init(handle: Mp3Handle) -> i32;
pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32;
pub fn sceMp3GetInfoToAddStreamData(
handle: Mp3Handle,
dst: *mut *mut u8,
to_write: *mut i32,
src_pos: *mut i32,
) -> i32;
pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32;
pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32;
pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32;
pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32;
pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32;
pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32;
pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32;
pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32;
pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32;
pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32;
pub fn sceRegOpenRegistry(reg: *mut Key, mode: i32, handle: *mut RegHandle) -> i32;
pub fn sceRegFlushRegistry(handle: RegHandle) -> i32;
pub fn sceRegCloseRegistry(handle: RegHandle) -> i32;
pub fn sceRegOpenCategory(
handle: RegHandle,
name: *const u8,
mode: i32,
dir_handle: *mut RegHandle,
) -> i32;
pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32;
pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32;
pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32;
pub fn sceRegGetKeyInfo(
dir_handle: RegHandle,
name: *const u8,
key_handle: *mut RegHandle,
type_: *mut KeyType,
size: *mut usize,
) -> i32;
pub fn sceRegGetKeyInfoByName(
dir_handle: RegHandle,
name: *const u8,
type_: *mut KeyType,
size: *mut usize,
) -> i32;
pub fn sceRegGetKeyValue(
dir_handle: RegHandle,
key_handle: RegHandle,
buf: *mut c_void,
size: usize,
) -> i32;
pub fn sceRegGetKeyValueByName(
dir_handle: RegHandle,
name: *const u8,
buf: *mut c_void,
size: usize,
) -> i32;
pub fn sceRegSetKeyValue(
dir_handle: RegHandle,
name: *const u8,
buf: *const c_void,
size: usize,
) -> i32;
pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32;
pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) -> i32;
pub fn sceRegCreateKey(dir_handle: RegHandle, name: *const u8, type_: i32, size: usize) -> i32;
pub fn sceRegRemoveRegistry(key: *mut Key) -> i32;
pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32;
pub fn sceUtilityMsgDialogInitStart(params: *mut UtilityMsgDialogParams) -> i32;
pub fn sceUtilityMsgDialogShutdownStart();
pub fn sceUtilityMsgDialogGetStatus() -> i32;
pub fn sceUtilityMsgDialogUpdate(n: i32);
pub fn sceUtilityMsgDialogAbort() -> i32;
pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32;
pub fn sceUtilityNetconfShutdownStart() -> i32;
pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32;
pub fn sceUtilityNetconfGetStatus() -> i32;
pub fn sceUtilityCheckNetParam(id: i32) -> i32;
pub fn sceUtilityGetNetParam(conf: i32, param: NetParam, data: *mut UtilityNetData) -> i32;
pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam) -> i32;
pub fn sceUtilitySavedataGetStatus() -> i32;
pub fn sceUtilitySavedataShutdownStart() -> i32;
pub fn sceUtilitySavedataUpdate(unknown: i32);
pub fn sceUtilityGameSharingInitStart(params: *mut UtilityGameSharingParams) -> i32;
pub fn sceUtilityGameSharingShutdownStart();
pub fn sceUtilityGameSharingGetStatus() -> i32;
pub fn sceUtilityGameSharingUpdate(n: i32);
pub fn sceUtilityHtmlViewerInitStart(params: *mut UtilityHtmlViewerParam) -> i32;
pub fn sceUtilityHtmlViewerShutdownStart() -> i32;
pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32;
pub fn sceUtilityHtmlViewerGetStatus() -> i32;
pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32;
pub fn sceUtilitySetSystemParamString(id: SystemParamId, str: *const u8) -> i32;
pub fn sceUtilityGetSystemParamInt(id: SystemParamId, value: *mut i32) -> i32;
pub fn sceUtilityGetSystemParamString(id: SystemParamId, str: *mut u8, len: i32) -> i32;
pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32;
pub fn sceUtilityOskShutdownStart() -> i32;
pub fn sceUtilityOskUpdate(n: i32) -> i32;
pub fn sceUtilityOskGetStatus() -> i32;
pub fn sceUtilityLoadNetModule(module: NetModule) -> i32;
pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32;
pub fn sceUtilityLoadAvModule(module: AvModule) -> i32;
pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32;
pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32;
pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32;
pub fn sceUtilityLoadModule(module: Module) -> i32;
pub fn sceUtilityUnloadModule(module: Module) -> i32;
pub fn sceUtilityCreateNetParam(conf: i32) -> i32;
pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32;
pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32;
pub fn sceUtilityDeleteNetParam(conf: i32) -> i32;
pub fn sceNetInit(
poolsize: i32,
calloutprio: i32,
calloutstack: i32,
netintrprio: i32,
netintrstack: i32,
) -> i32;
pub fn sceNetTerm() -> i32;
pub fn sceNetFreeThreadinfo(thid: i32) -> i32;
pub fn sceNetThreadAbort(thid: i32) -> i32;
pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8);
pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8);
pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32;
pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32;
pub fn sceNetAdhocctlInit(
stacksize: i32,
priority: i32,
adhoc_id: *mut SceNetAdhocctlAdhocId,
) -> i32;
pub fn sceNetAdhocctlTerm() -> i32;
pub fn sceNetAdhocctlConnect(name: *const u8) -> i32;
pub fn sceNetAdhocctlDisconnect() -> i32;
pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32;
pub fn sceNetAdhocctlCreate(name: *const u8) -> i32;
pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32;
pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32;
pub fn sceNetAdhocctlCreateEnterGameMode(
name: *const u8,
unknown: i32,
num: i32,
macs: *mut u8,
timeout: u32,
unknown2: i32,
) -> i32;
pub fn sceNetAdhocctlJoinEnterGameMode(
name: *const u8,
hostmac: *mut u8,
timeout: u32,
unknown: i32,
) -> i32;
pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo: *mut SceNetAdhocctlGameModeInfo) -> i32;
pub fn sceNetAdhocctlExitGameMode() -> i32;
pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void) -> i32;
pub fn sceNetAdhocctlGetPeerInfo(
mac: *mut u8,
size: i32,
peerinfo: *mut SceNetAdhocctlPeerInfo,
) -> i32;
pub fn sceNetAdhocctlScan() -> i32;
pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void) -> i32;
pub fn sceNetAdhocctlAddHandler(handler: SceNetAdhocctlHandler, unknown: *mut c_void) -> i32;
pub fn sceNetAdhocctlDelHandler(id: i32) -> i32;
pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) -> i32;
pub fn sceNetAdhocctlGetAddrByName(
nickname: *mut u8,
length: *mut i32,
buf: *mut c_void,
) -> i32;
pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams) -> i32;
pub fn sceNetAdhocInit() -> i32;
pub fn sceNetAdhocTerm() -> i32;
pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16, buf_size: u32, unk1: i32) -> i32;
pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32;
pub fn sceNetAdhocPdpSend(
id: i32,
dest_mac_addr: *mut u8,
port: u16,
data: *mut c_void,
len: u32,
timeout: u32,
nonblock: i32,
) -> i32;
pub fn sceNetAdhocPdpRecv(
id: i32,
src_mac_addr: *mut u8,
port: *mut u16,
data: *mut c_void,
data_length: *mut c_void,
timeout: u32,
nonblock: i32,
) -> i32;
pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut SceNetAdhocPdpStat) -> i32;
pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32) -> i32;
pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8, data: *mut c_void, size: i32) -> i32;
pub fn sceNetAdhocGameModeUpdateMaster() -> i32;
pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32;
pub fn sceNetAdhocGameModeDeleteMaster() -> i32;
pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32;
pub fn sceNetAdhocPtpOpen(
srcmac: *mut u8,
srcport: u16,
destmac: *mut u8,
destport: u16,
buf_size: u32,
delay: u32,
count: i32,
unk1: i32,
) -> i32;
pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32;
pub fn sceNetAdhocPtpListen(
srcmac: *mut u8,
srcport: u16,
buf_size: u32,
delay: u32,
count: i32,
queue: i32,
unk1: i32,
) -> i32;
pub fn sceNetAdhocPtpAccept(
id: i32,
mac: *mut u8,
port: *mut u16,
timeout: u32,
nonblock: i32,
) -> i32;
pub fn sceNetAdhocPtpSend(
id: i32,
data: *mut c_void,
data_size: *mut i32,
timeout: u32,
nonblock: i32,
) -> i32;
pub fn sceNetAdhocPtpRecv(
id: i32,
data: *mut c_void,
data_size: *mut i32,
timeout: u32,
nonblock: i32,
) -> i32;
pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32;
pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32;
pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut SceNetAdhocPtpStat) -> i32;
}
extern "C" {
pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32;
pub fn sceNetAdhocMatchingTerm() -> i32;
pub fn sceNetAdhocMatchingCreate(
mode: AdhocMatchingMode,
max_peers: i32,
port: u16,
buf_size: i32,
hello_delay: u32,
ping_delay: u32,
init_count: i32,
msg_delay: u32,
callback: AdhocMatchingCallback,
) -> i32;
pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32;
pub fn sceNetAdhocMatchingStart(
matching_id: i32,
evth_pri: i32,
evth_stack: i32,
inth_pri: i32,
inth_stack: i32,
opt_len: i32,
opt_data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32;
pub fn sceNetAdhocMatchingSelectTarget(
matching_id: i32,
mac: *mut u8,
opt_len: i32,
opt_data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingCancelTarget(matching_id: i32, mac: *mut u8) -> i32;
pub fn sceNetAdhocMatchingCancelTargetWithOpt(
matching_id: i32,
mac: *mut u8,
opt_len: i32,
opt_data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingSendData(
matching_id: i32,
mac: *mut u8,
data_len: i32,
data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingAbortSendData(matching_id: i32, mac: *mut u8) -> i32;
pub fn sceNetAdhocMatchingSetHelloOpt(
matching_id: i32,
opt_len: i32,
opt_data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingGetHelloOpt(
matching_id: i32,
opt_len: *mut i32,
opt_data: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingGetMembers(
matching_id: i32,
length: *mut i32,
buf: *mut c_void,
) -> i32;
pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32;
pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) -> i32;
}
extern "C" {
pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32;
pub fn sceNetApctlTerm() -> i32;
pub fn sceNetApctlGetInfo(code: ApctlInfo, pinfo: *mut SceNetApctlInfo) -> i32;
pub fn sceNetApctlAddHandler(handler: SceNetApctlHandler, parg: *mut c_void) -> i32;
pub fn sceNetApctlDelHandler(handler_id: i32) -> i32;
pub fn sceNetApctlConnect(conn_index: i32) -> i32;
pub fn sceNetApctlDisconnect() -> i32;
pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32;
pub fn sceNetInetInit() -> i32;
pub fn sceNetInetTerm() -> i32;
pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr, addr_len: *mut socklen_t) -> i32;
pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr, addr_len: socklen_t) -> i32;
pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr, addr_len: socklen_t) -> i32;
pub fn sceNetInetGetsockopt(
s: i32,
level: i32,
opt_name: i32,
opt_val: *mut c_void,
optl_en: *mut socklen_t,
) -> i32;
pub fn sceNetInetListen(s: i32, backlog: i32) -> i32;
pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize, flags: i32) -> usize;
pub fn sceNetInetRecvfrom(
s: i32,
buf: *mut c_void,
flags: usize,
arg1: i32,
from: *mut sockaddr,
from_len: *mut socklen_t,
) -> usize;
pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize, flags: i32) -> usize;
pub fn sceNetInetSendto(
s: i32,
buf: *const c_void,
len: usize,
flags: i32,
to: *const sockaddr,
to_len: socklen_t,
) -> usize;
pub fn sceNetInetSetsockopt(
s: i32,
level: i32,
opt_name: i32,
opt_val: *const c_void,
opt_len: socklen_t,
) -> i32;
pub fn sceNetInetShutdown(s: i32, how: i32) -> i32;
pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32;
pub fn sceNetInetClose(s: i32) -> i32;
pub fn sceNetInetGetErrno() -> i32;
pub fn sceSslInit(unknown1: i32) -> i32;
pub fn sceSslEnd() -> i32;
pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32;
pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32;
pub fn sceHttpInit(unknown1: u32) -> i32;
pub fn sceHttpEnd() -> i32;
pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32, unknown2: i32) -> i32;
pub fn sceHttpDeleteTemplate(templateid: i32) -> i32;
pub fn sceHttpCreateConnection(
templateid: i32,
host: *mut u8,
unknown1: *mut u8,
port: u16,
unknown2: i32,
) -> i32;
pub fn sceHttpCreateConnectionWithURL(templateid: i32, url: *const u8, unknown1: i32) -> i32;
pub fn sceHttpDeleteConnection(connection_id: i32) -> i32;
pub fn sceHttpCreateRequest(
connection_id: i32,
method: HttpMethod,
path: *mut u8,
content_length: u64,
) -> i32;
pub fn sceHttpCreateRequestWithURL(
connection_id: i32,
method: HttpMethod,
url: *mut u8,
content_length: u64,
) -> i32;
pub fn sceHttpDeleteRequest(request_id: i32) -> i32;
pub fn sceHttpSendRequest(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
pub fn sceHttpAbortRequest(request_id: i32) -> i32;
pub fn sceHttpReadData(request_id: i32, data: *mut c_void, data_size: u32) -> i32;
pub fn sceHttpGetContentLength(request_id: i32, content_length: *mut u64) -> i32;
pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) -> i32;
pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32;
pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32;
pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32;
pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32;
pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32;
pub fn sceHttpEnableKeepAlive(id: i32) -> i32;
pub fn sceHttpDisableKeepAlive(id: i32) -> i32;
pub fn sceHttpEnableRedirect(id: i32) -> i32;
pub fn sceHttpDisableRedirect(id: i32) -> i32;
pub fn sceHttpEnableCookie(id: i32) -> i32;
pub fn sceHttpDisableCookie(id: i32) -> i32;
pub fn sceHttpSaveSystemCookie() -> i32;
pub fn sceHttpLoadSystemCookie() -> i32;
pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8, value: *mut u8, unknown1: i32) -> i32;
pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32;
pub fn sceHttpsInit(unknown1: i32, unknown2: i32, unknown3: i32, unknown4: i32) -> i32;
pub fn sceHttpsEnd() -> i32;
pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32;
pub fn sceHttpDisableAuth(id: i32) -> i32;
pub fn sceHttpDisableCache(id: i32) -> i32;
pub fn sceHttpEnableAuth(id: i32) -> i32;
pub fn sceHttpEnableCache(id: i32) -> i32;
pub fn sceHttpEndCache() -> i32;
pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8, header_size: *mut u32) -> i32;
pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32;
pub fn sceHttpGetProxy(
id: i32,
activate_flag: *mut i32,
mode: *mut i32,
proxy_host: *mut u8,
len: usize,
proxy_port: *mut u16,
) -> i32;
pub fn sceHttpInitCache(max_size: usize) -> i32;
pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32;
pub fn sceHttpSetProxy(
id: i32,
activate_flag: i32,
mode: i32,
new_proxy_host: *const u8,
new_proxy_port: u16,
) -> i32;
pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32;
pub fn sceHttpSetMallocFunction(
malloc_func: HttpMallocFunction,
free_func: HttpFreeFunction,
realloc_func: HttpReallocFunction,
) -> i32;
pub fn sceNetResolverInit() -> i32;
pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void, buf_length: u32) -> i32;
pub fn sceNetResolverDelete(rid: i32) -> i32;
pub fn sceNetResolverStartNtoA(
rid: i32,
hostname: *const u8,
addr: *mut in_addr,
timeout: u32,
retry: i32,
) -> i32;
pub fn sceNetResolverStartAtoN(
rid: i32,
addr: *const in_addr,
hostname: *mut u8,
hostname_len: u32,
timeout: u32,
retry: i32,
) -> i32;
pub fn sceNetResolverStop(rid: i32) -> i32;
pub fn sceNetResolverTerm() -> i32;
}
libc-0.2.152/src/sgx.rs 0000644 0000000 0000000 00000002301 10461020230 0012636 0 ustar 0000000 0000000 //! SGX C types definition
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
libc-0.2.152/src/solid/aarch64.rs 0000644 0000000 0000000 00000000135 10461020230 0014402 0 ustar 0000000 0000000 pub type c_char = i8;
pub type wchar_t = u32;
pub type c_long = i64;
pub type c_ulong = u64;
libc-0.2.152/src/solid/arm.rs 0000644 0000000 0000000 00000000135 10461020230 0013731 0 ustar 0000000 0000000 pub type c_char = i8;
pub type wchar_t = u32;
pub type c_long = i32;
pub type c_ulong = u32;
libc-0.2.152/src/solid/mod.rs 0000644 0000000 0000000 00000100657 10461020230 0013743 0 ustar 0000000 0000000 //! Interface to the [SOLID] C library
//!
//! [SOLID]: https://solid.kmckk.com/
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type uintptr_t = usize;
pub type intptr_t = isize;
pub type ptrdiff_t = isize;
pub type size_t = ::uintptr_t;
pub type ssize_t = ::intptr_t;
pub type clock_t = c_uint;
pub type time_t = i64;
pub type clockid_t = c_int;
pub type timer_t = c_int;
pub type suseconds_t = c_int;
pub type useconds_t = c_uint;
pub type sighandler_t = size_t;
// sys/ansi.h
pub type __caddr_t = *mut c_char;
pub type __gid_t = u32;
pub type __in_addr_t = u32;
pub type __in_port_t = u16;
pub type __mode_t = u32;
pub type __off_t = i64;
pub type __pid_t = i32;
pub type __sa_family_t = u8;
pub type __socklen_t = c_uint;
pub type __uid_t = u32;
pub type __fsblkcnt_t = u64;
pub type __fsfilcnt_t = u64;
// locale.h
pub type locale_t = usize;
// nl_types.h
pub type nl_item = c_long;
// sys/types.h
pub type __va_list = *mut c_char;
pub type u_int8_t = u8;
pub type u_int16_t = u16;
pub type u_int32_t = u32;
pub type u_int64_t = u64;
pub type u_char = c_uchar;
pub type u_short = c_ushort;
pub type u_int = c_uint;
pub type u_long = c_ulong;
pub type unchar = c_uchar;
pub type ushort = c_ushort;
pub type uint = c_uint;
pub type ulong = c_ulong;
pub type u_quad_t = u64;
pub type quad_t = i64;
pub type qaddr_t = *mut quad_t;
pub type longlong_t = i64;
pub type u_longlong_t = u64;
pub type blkcnt_t = i64;
pub type blksize_t = i32;
pub type fsblkcnt_t = __fsblkcnt_t;
pub type fsfilcnt_t = __fsfilcnt_t;
pub type caddr_t = __caddr_t;
pub type daddr_t = i64;
pub type dev_t = u64;
pub type fixpt_t = u32;
pub type gid_t = __gid_t;
pub type idtype_t = c_int;
pub type id_t = u32;
pub type ino_t = u64;
pub type key_t = c_long;
pub type mode_t = __mode_t;
pub type nlink_t = u32;
pub type off_t = __off_t;
pub type pid_t = __pid_t;
pub type lwpid_t = i32;
pub type rlim_t = u64;
pub type segsz_t = i32;
pub type swblk_t = i32;
pub type mqd_t = c_int;
pub type cpuid_t = c_ulong;
pub type psetid_t = c_int;
s! {
// stat.h
pub struct stat {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: c_short,
pub st_nlink: c_short,
pub st_uid: c_short,
pub st_gid: c_short,
pub st_rdev: dev_t,
pub st_size: off_t,
pub st_atime: time_t,
pub st_mtime: time_t,
pub st_ctime: time_t,
pub st_blksize: blksize_t,
}
// time.h
pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
pub tm_gmtoff: c_long,
pub tm_zone: *mut c_char,
}
// stdlib.h
pub struct qdiv_t {
pub quot: quad_t,
pub rem: quad_t,
}
pub struct lldiv_t {
pub quot: c_longlong,
pub rem: c_longlong,
}
pub struct div_t {
pub quot: c_int,
pub rem: c_int,
}
pub struct ldiv_t {
pub quot: c_long,
pub rem: c_long,
}
// locale.h
pub struct lconv {
pub decimal_point: *mut c_char,
pub thousands_sep: *mut c_char,
pub grouping: *mut c_char,
pub int_curr_symbol: *mut c_char,
pub currency_symbol: *mut c_char,
pub mon_decimal_point: *mut c_char,
pub mon_thousands_sep: *mut c_char,
pub mon_grouping: *mut c_char,
pub positive_sign: *mut c_char,
pub negative_sign: *mut c_char,
pub int_frac_digits: c_char,
pub frac_digits: c_char,
pub p_cs_precedes: c_char,
pub p_sep_by_space: c_char,
pub n_cs_precedes: c_char,
pub n_sep_by_space: c_char,
pub p_sign_posn: c_char,
pub n_sign_posn: c_char,
pub int_p_cs_precedes: c_char,
pub int_n_cs_precedes: c_char,
pub int_p_sep_by_space: c_char,
pub int_n_sep_by_space: c_char,
pub int_p_sign_posn: c_char,
pub int_n_sign_posn: c_char,
}
pub struct iovec {
pub iov_base: *mut c_void,
pub iov_len: size_t,
}
pub struct timeval {
pub tv_sec: c_long,
pub tv_usec: c_long,
}
}
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
pub const EXIT_FAILURE: c_int = 1;
pub const EXIT_SUCCESS: c_int = 0;
pub const RAND_MAX: c_int = 0x7fffffff;
pub const EOF: c_int = -1;
pub const SEEK_SET: c_int = 0;
pub const SEEK_CUR: c_int = 1;
pub const SEEK_END: c_int = 2;
pub const _IOFBF: c_int = 0;
pub const _IONBF: c_int = 2;
pub const _IOLBF: c_int = 1;
pub const BUFSIZ: c_uint = 1024;
pub const FOPEN_MAX: c_uint = 20;
pub const FILENAME_MAX: c_uint = 1024;
pub const O_RDONLY: c_int = 1;
pub const O_WRONLY: c_int = 2;
pub const O_RDWR: c_int = 4;
pub const O_APPEND: c_int = 8;
pub const O_CREAT: c_int = 0x10;
pub const O_EXCL: c_int = 0x400;
pub const O_TEXT: c_int = 0x100;
pub const O_BINARY: c_int = 0x200;
pub const O_TRUNC: c_int = 0x20;
pub const S_IEXEC: c_short = 0x0040;
pub const S_IWRITE: c_short = 0x0080;
pub const S_IREAD: c_short = 0x0100;
pub const S_IFCHR: c_short = 0x2000;
pub const S_IFDIR: c_short = 0x4000;
pub const S_IFMT: c_short = 0o160000;
pub const S_IFIFO: c_short = 0o0010000;
pub const S_IFBLK: c_short = 0o0060000;
pub const S_IFREG: c_short = 0o0100000;
pub const LC_ALL: c_int = 0;
pub const LC_COLLATE: c_int = 1;
pub const LC_CTYPE: c_int = 2;
pub const LC_MONETARY: c_int = 3;
pub const LC_NUMERIC: c_int = 4;
pub const LC_TIME: c_int = 5;
pub const LC_MESSAGES: c_int = 6;
pub const _LC_LAST: c_int = 7;
pub const EPERM: c_int = 1;
pub const ENOENT: c_int = 2;
pub const ESRCH: c_int = 3;
pub const EINTR: c_int = 4;
pub const EIO: c_int = 5;
pub const ENXIO: c_int = 6;
pub const E2BIG: c_int = 7;
pub const ENOEXEC: c_int = 8;
pub const EBADF: c_int = 9;
pub const ECHILD: c_int = 10;
pub const EAGAIN: c_int = 11;
pub const ENOMEM: c_int = 12;
pub const EACCES: c_int = 13;
pub const EFAULT: c_int = 14;
pub const ENOTBLK: c_int = 15;
pub const EBUSY: c_int = 16;
pub const EEXIST: c_int = 17;
pub const EXDEV: c_int = 18;
pub const ENODEV: c_int = 19;
pub const ENOTDIR: c_int = 20;
pub const EISDIR: c_int = 21;
pub const EINVAL: c_int = 22;
pub const ENFILE: c_int = 23;
pub const EMFILE: c_int = 24;
pub const ENOTTY: c_int = 25;
pub const ETXTBSY: c_int = 26;
pub const EFBIG: c_int = 27;
pub const ENOSPC: c_int = 28;
pub const ESPIPE: c_int = 29;
pub const EROFS: c_int = 30;
pub const EMLINK: c_int = 31;
pub const EPIPE: c_int = 32;
pub const EDOM: c_int = 33;
pub const ERANGE: c_int = 34;
pub const EDEADLK: c_int = 35;
pub const ENAMETOOLONG: c_int = 36;
pub const ENOLCK: c_int = 37;
pub const ENOSYS: c_int = 38;
pub const ENOTEMPTY: c_int = 39;
pub const ELOOP: c_int = 40;
pub const EWOULDBLOCK: c_int = EAGAIN;
pub const ENOMSG: c_int = 42;
pub const EIDRM: c_int = 43;
pub const ECHRNG: c_int = 44;
pub const EL2NSYNC: c_int = 45;
pub const EL3HLT: c_int = 46;
pub const EL3RST: c_int = 47;
pub const ELNRNG: c_int = 48;
pub const EUNATCH: c_int = 49;
pub const ENOCSI: c_int = 50;
pub const EL2HLT: c_int = 51;
pub const EBADE: c_int = 52;
pub const EBADR: c_int = 53;
pub const EXFULL: c_int = 54;
pub const ENOANO: c_int = 55;
pub const EBADRQC: c_int = 56;
pub const EBADSLT: c_int = 57;
pub const EDEADLOCK: c_int = EDEADLK;
pub const EBFONT: c_int = 59;
pub const ENOSTR: c_int = 60;
pub const ENODATA: c_int = 61;
pub const ETIME: c_int = 62;
pub const ENOSR: c_int = 63;
pub const ENONET: c_int = 64;
pub const ENOPKG: c_int = 65;
pub const EREMOTE: c_int = 66;
pub const ENOLINK: c_int = 67;
pub const EADV: c_int = 68;
pub const ESRMNT: c_int = 69;
pub const ECOMM: c_int = 70;
pub const EPROTO: c_int = 71;
pub const EMULTIHOP: c_int = 72;
pub const EDOTDOT: c_int = 73;
pub const EBADMSG: c_int = 74;
pub const EOVERFLOW: c_int = 75;
pub const ENOTUNIQ: c_int = 76;
pub const EBADFD: c_int = 77;
pub const EREMCHG: c_int = 78;
pub const ELIBACC: c_int = 79;
pub const ELIBBAD: c_int = 80;
pub const ELIBSCN: c_int = 81;
pub const ELIBMAX: c_int = 82;
pub const ELIBEXEC: c_int = 83;
pub const EILSEQ: c_int = 84;
pub const ERESTART: c_int = 85;
pub const ESTRPIPE: c_int = 86;
pub const EUSERS: c_int = 87;
pub const ENOTSOCK: c_int = 88;
pub const EDESTADDRREQ: c_int = 89;
pub const EMSGSIZE: c_int = 90;
pub const EPROTOTYPE: c_int = 91;
pub const ENOPROTOOPT: c_int = 92;
pub const EPROTONOSUPPORT: c_int = 93;
pub const ESOCKTNOSUPPORT: c_int = 94;
pub const EOPNOTSUPP: c_int = 95;
pub const EPFNOSUPPORT: c_int = 96;
pub const EAFNOSUPPORT: c_int = 97;
pub const EADDRINUSE: c_int = 98;
pub const EADDRNOTAVAIL: c_int = 99;
pub const ENETDOWN: c_int = 100;
pub const ENETUNREACH: c_int = 101;
pub const ENETRESET: c_int = 102;
pub const ECONNABORTED: c_int = 103;
pub const ECONNRESET: c_int = 104;
pub const ENOBUFS: c_int = 105;
pub const EISCONN: c_int = 106;
pub const ENOTCONN: c_int = 107;
pub const ESHUTDOWN: c_int = 108;
pub const ETOOMANYREFS: c_int = 109;
pub const ETIMEDOUT: c_int = 110;
pub const ECONNREFUSED: c_int = 111;
pub const EHOSTDOWN: c_int = 112;
pub const EHOSTUNREACH: c_int = 113;
pub const EALREADY: c_int = 114;
pub const EINPROGRESS: c_int = 115;
pub const ESTALE: c_int = 116;
pub const EUCLEAN: c_int = 117;
pub const ENOTNAM: c_int = 118;
pub const ENAVAIL: c_int = 119;
pub const EISNAM: c_int = 120;
pub const EREMOTEIO: c_int = 121;
pub const EDQUOT: c_int = 122;
pub const ENOMEDIUM: c_int = 123;
pub const EMEDIUMTYPE: c_int = 124;
pub const ECANCELED: c_int = 125;
pub const ENOKEY: c_int = 126;
pub const EKEYEXPIRED: c_int = 127;
pub const EKEYREVOKED: c_int = 128;
pub const EKEYREJECTED: c_int = 129;
pub const EOWNERDEAD: c_int = 130;
pub const ENOTRECOVERABLE: c_int = 131;
pub const ENOTSUP: c_int = 132;
pub const EFTYPE: c_int = 133;
// signal codes
pub const SIGHUP: c_int = 1;
pub const SIGINT: c_int = 2;
pub const SIGQUIT: c_int = 3;
pub const SIGILL: c_int = 4;
pub const SIGTRAP: c_int = 5;
pub const SIGABRT: c_int = 6;
pub const SIGIOT: c_int = SIGABRT;
pub const SIGEMT: c_int = 7;
pub const SIGFPE: c_int = 8;
pub const SIGKILL: c_int = 9;
pub const SIGBUS: c_int = 10;
pub const SIGSEGV: c_int = 11;
pub const SIGSYS: c_int = 12;
pub const SIGPIPE: c_int = 13;
pub const SIGALRM: c_int = 14;
pub const SIGTERM: c_int = 15;
pub const SIGURG: c_int = 16;
pub const SIGSTOP: c_int = 17;
pub const SIGTSTP: c_int = 18;
pub const SIGCONT: c_int = 19;
pub const SIGCHLD: c_int = 20;
pub const SIGTTIN: c_int = 21;
pub const SIGTTOU: c_int = 22;
pub const SIGIO: c_int = 23;
pub const SIGXCPU: c_int = 24;
pub const SIGXFSZ: c_int = 25;
pub const SIGVTALRM: c_int = 26;
pub const SIGPROF: c_int = 27;
pub const SIGWINCH: c_int = 28;
pub const SIGINFO: c_int = 29;
pub const SIGUSR1: c_int = 30;
pub const SIGUSR2: c_int = 31;
pub const SIGPWR: c_int = 32;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum FILE {}
impl ::Copy for FILE {}
impl ::Clone for FILE {
fn clone(&self) -> FILE {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum fpos_t {}
impl ::Copy for fpos_t {}
impl ::Clone for fpos_t {
fn clone(&self) -> fpos_t {
*self
}
}
extern "C" {
// ctype.h
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn isgraph(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn ispunct(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn isupper(c: c_int) -> c_int;
pub fn isxdigit(c: c_int) -> c_int;
pub fn isblank(c: c_int) -> c_int;
pub fn tolower(c: c_int) -> c_int;
pub fn toupper(c: c_int) -> c_int;
// stdio.h
pub fn __get_stdio_file(fileno: c_int) -> *mut FILE;
pub fn clearerr(arg1: *mut FILE);
pub fn fclose(arg1: *mut FILE) -> c_int;
pub fn feof(arg1: *mut FILE) -> c_int;
pub fn ferror(arg1: *mut FILE) -> c_int;
pub fn fflush(arg1: *mut FILE) -> c_int;
pub fn fgetc(arg1: *mut FILE) -> c_int;
pub fn fgets(arg1: *mut c_char, arg2: c_int, arg3: *mut FILE) -> *mut c_char;
pub fn fopen(arg1: *const c_char, arg2: *const c_char) -> *mut FILE;
pub fn fprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
pub fn fputc(arg1: c_int, arg2: *mut FILE) -> c_int;
pub fn fputs(arg1: *const c_char, arg2: *mut FILE) -> c_int;
pub fn fread(arg1: *mut c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
pub fn freopen(arg1: *const c_char, arg2: *const c_char, arg3: *mut FILE) -> *mut FILE;
pub fn fscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
pub fn fseek(arg1: *mut FILE, arg2: c_long, arg3: c_int) -> c_int;
pub fn ftell(arg1: *mut FILE) -> c_long;
pub fn fwrite(arg1: *const c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t;
pub fn getc(arg1: *mut FILE) -> c_int;
pub fn getchar() -> c_int;
pub fn perror(arg1: *const c_char);
pub fn printf(arg1: *const c_char, ...) -> c_int;
pub fn putc(arg1: c_int, arg2: *mut FILE) -> c_int;
pub fn putchar(arg1: c_int) -> c_int;
pub fn puts(arg1: *const c_char) -> c_int;
pub fn remove(arg1: *const c_char) -> c_int;
pub fn rewind(arg1: *mut FILE);
pub fn scanf(arg1: *const c_char, ...) -> c_int;
pub fn setbuf(arg1: *mut FILE, arg2: *mut c_char);
pub fn setvbuf(arg1: *mut FILE, arg2: *mut c_char, arg3: c_int, arg4: size_t) -> c_int;
pub fn sscanf(arg1: *const c_char, arg2: *const c_char, ...) -> c_int;
pub fn tmpfile() -> *mut FILE;
pub fn ungetc(arg1: c_int, arg2: *mut FILE) -> c_int;
pub fn vfprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn vprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
pub fn gets(arg1: *mut c_char) -> *mut c_char;
pub fn sprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
pub fn tmpnam(arg1: *const c_char) -> *mut c_char;
pub fn vsprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn rename(arg1: *const c_char, arg2: *const c_char) -> c_int;
pub fn asiprintf(arg1: *mut *mut c_char, arg2: *const c_char, ...) -> c_int;
pub fn fiprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
pub fn fiscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int;
pub fn iprintf(arg1: *const c_char, ...) -> c_int;
pub fn iscanf(arg1: *const c_char, ...) -> c_int;
pub fn siprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
pub fn siscanf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int;
pub fn sniprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
pub fn vasiprintf(arg1: *mut *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn vfiprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn vfiscanf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn viprintf(arg1: *const c_char, arg2: __va_list) -> c_int;
pub fn viscanf(arg1: *const c_char, arg2: __va_list) -> c_int;
pub fn vsiprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn vsiscanf(arg1: *const c_char, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn vsniprintf(
arg1: *mut c_char,
arg2: size_t,
arg3: *const c_char,
arg4: __va_list,
) -> c_int;
pub fn vdiprintf(arg1: c_int, arg2: *const c_char, arg3: __va_list) -> c_int;
pub fn diprintf(arg1: c_int, arg2: *const c_char, ...) -> c_int;
pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> c_int;
pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> c_int;
pub fn fdopen(arg1: c_int, arg2: *const c_char) -> *mut FILE;
pub fn fileno(arg1: *mut FILE) -> c_int;
pub fn flockfile(arg1: *mut FILE);
pub fn ftrylockfile(arg1: *mut FILE) -> c_int;
pub fn funlockfile(arg1: *mut FILE);
pub fn getc_unlocked(arg1: *mut FILE) -> c_int;
pub fn getchar_unlocked() -> c_int;
pub fn putc_unlocked(arg1: c_int, arg2: *mut FILE) -> c_int;
pub fn putchar_unlocked(arg1: c_int) -> c_int;
pub fn snprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int;
pub fn vsnprintf(
arg1: *mut c_char,
arg2: size_t,
arg3: *const c_char,
arg4: __va_list,
) -> c_int;
pub fn getw(arg1: *mut FILE) -> c_int;
pub fn putw(arg1: c_int, arg2: *mut FILE) -> c_int;
pub fn tempnam(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
pub fn fseeko(stream: *mut FILE, offset: off_t, whence: c_int) -> c_int;
pub fn ftello(stream: *mut FILE) -> off_t;
// stdlib.h
pub fn atof(arg1: *const c_char) -> f64;
pub fn strtod(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
pub fn drand48() -> f64;
pub fn erand48(arg1: *mut c_ushort) -> f64;
pub fn strtof(arg1: *const c_char, arg2: *mut *mut c_char) -> f32;
pub fn strtold(arg1: *const c_char, arg2: *mut *mut c_char) -> f64;
pub fn strtod_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
pub fn strtof_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f32;
pub fn strtold_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64;
pub fn _Exit(arg1: c_int) -> !;
pub fn abort() -> !;
pub fn abs(arg1: c_int) -> c_int;
pub fn atexit(arg1: ::Option) -> c_int;
pub fn atoi(arg1: *const c_char) -> c_int;
pub fn atol(arg1: *const c_char) -> c_long;
pub fn itoa(arg1: c_int, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
pub fn ltoa(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
pub fn ultoa(arg1: c_ulong, arg2: *mut c_char, arg3: c_int) -> *mut c_char;
pub fn bsearch(
arg1: *const c_void,
arg2: *const c_void,
arg3: size_t,
arg4: size_t,
arg5: ::Option c_int>,
) -> *mut c_void;
pub fn calloc(arg1: size_t, arg2: size_t) -> *mut c_void;
pub fn div(arg1: c_int, arg2: c_int) -> div_t;
pub fn exit(arg1: c_int) -> !;
pub fn free(arg1: *mut c_void);
pub fn getenv(arg1: *const c_char) -> *mut c_char;
pub fn labs(arg1: c_long) -> c_long;
pub fn ldiv(arg1: c_long, arg2: c_long) -> ldiv_t;
pub fn malloc(arg1: size_t) -> *mut c_void;
pub fn qsort(
arg1: *mut c_void,
arg2: size_t,
arg3: size_t,
arg4: ::Option c_int>,
);
pub fn rand() -> c_int;
pub fn realloc(arg1: *mut c_void, arg2: size_t) -> *mut c_void;
pub fn srand(arg1: c_uint);
pub fn strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long;
pub fn strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong;
pub fn mblen(arg1: *const c_char, arg2: size_t) -> c_int;
pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> size_t;
pub fn wctomb(arg1: *mut c_char, arg2: wchar_t) -> c_int;
pub fn mbtowc(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> c_int;
pub fn wcstombs(arg1: *mut c_char, arg2: *const wchar_t, arg3: size_t) -> size_t;
pub fn rand_r(arg1: *mut c_uint) -> c_int;
pub fn jrand48(arg1: *mut c_ushort) -> c_long;
pub fn lcong48(arg1: *mut c_ushort);
pub fn lrand48() -> c_long;
pub fn mrand48() -> c_long;
pub fn nrand48(arg1: *mut c_ushort) -> c_long;
pub fn seed48(arg1: *mut c_ushort) -> *mut c_ushort;
pub fn srand48(arg1: c_long);
pub fn putenv(arg1: *mut c_char) -> c_int;
pub fn a64l(arg1: *const c_char) -> c_long;
pub fn l64a(arg1: c_long) -> *mut c_char;
pub fn random() -> c_long;
pub fn setstate(arg1: *mut c_char) -> *mut c_char;
pub fn initstate(arg1: c_uint, arg2: *mut c_char, arg3: size_t) -> *mut c_char;
pub fn srandom(arg1: c_uint);
pub fn mkostemp(arg1: *mut c_char, arg2: c_int) -> c_int;
pub fn mkostemps(arg1: *mut c_char, arg2: c_int, arg3: c_int) -> c_int;
pub fn mkdtemp(arg1: *mut c_char) -> *mut c_char;
pub fn mkstemp(arg1: *mut c_char) -> c_int;
pub fn mktemp(arg1: *mut c_char) -> *mut c_char;
pub fn atoll(arg1: *const c_char) -> c_longlong;
pub fn llabs(arg1: c_longlong) -> c_longlong;
pub fn lldiv(arg1: c_longlong, arg2: c_longlong) -> lldiv_t;
pub fn strtoll(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_longlong;
pub fn strtoull(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulonglong;
pub fn aligned_alloc(arg1: size_t, arg2: size_t) -> *mut c_void;
pub fn at_quick_exit(arg1: ::Option) -> c_int;
pub fn quick_exit(arg1: c_int);
pub fn setenv(arg1: *const c_char, arg2: *const c_char, arg3: c_int) -> c_int;
pub fn unsetenv(arg1: *const c_char) -> c_int;
pub fn humanize_number(
arg1: *mut c_char,
arg2: size_t,
arg3: i64,
arg4: *const c_char,
arg5: c_int,
arg6: c_int,
) -> c_int;
pub fn dehumanize_number(arg1: *const c_char, arg2: *mut i64) -> c_int;
pub fn getenv_r(arg1: *const c_char, arg2: *mut c_char, arg3: size_t) -> c_int;
pub fn heapsort(
arg1: *mut c_void,
arg2: size_t,
arg3: size_t,
arg4: ::Option c_int>,
) -> c_int;
pub fn mergesort(
arg1: *mut c_void,
arg2: size_t,
arg3: size_t,
arg4: ::Option c_int>,
) -> c_int;
pub fn radixsort(
arg1: *mut *const c_uchar,
arg2: c_int,
arg3: *const c_uchar,
arg4: c_uint,
) -> c_int;
pub fn sradixsort(
arg1: *mut *const c_uchar,
arg2: c_int,
arg3: *const c_uchar,
arg4: c_uint,
) -> c_int;
pub fn getprogname() -> *const c_char;
pub fn setprogname(arg1: *const c_char);
pub fn qabs(arg1: quad_t) -> quad_t;
pub fn strtoq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> quad_t;
pub fn strtouq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> u_quad_t;
pub fn strsuftoll(
arg1: *const c_char,
arg2: *const c_char,
arg3: c_longlong,
arg4: c_longlong,
) -> c_longlong;
pub fn strsuftollx(
arg1: *const c_char,
arg2: *const c_char,
arg3: c_longlong,
arg4: c_longlong,
arg5: *mut c_char,
arg6: size_t,
) -> c_longlong;
pub fn l64a_r(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> c_int;
pub fn qdiv(arg1: quad_t, arg2: quad_t) -> qdiv_t;
pub fn strtol_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> c_long;
pub fn strtoul_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> c_ulong;
pub fn strtoll_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> c_longlong;
pub fn strtoull_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> c_ulonglong;
pub fn strtoq_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> quad_t;
pub fn strtouq_l(
arg1: *const c_char,
arg2: *mut *mut c_char,
arg3: c_int,
arg4: locale_t,
) -> u_quad_t;
pub fn _mb_cur_max_l(arg1: locale_t) -> size_t;
pub fn mblen_l(arg1: *const c_char, arg2: size_t, arg3: locale_t) -> c_int;
pub fn mbstowcs_l(
arg1: *mut wchar_t,
arg2: *const c_char,
arg3: size_t,
arg4: locale_t,
) -> size_t;
pub fn wctomb_l(arg1: *mut c_char, arg2: wchar_t, arg3: locale_t) -> c_int;
pub fn mbtowc_l(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t, arg4: locale_t)
-> c_int;
pub fn wcstombs_l(
arg1: *mut c_char,
arg2: *const wchar_t,
arg3: size_t,
arg4: locale_t,
) -> size_t;
// string.h
pub fn memchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
pub fn memcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
pub fn memcpy(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
pub fn memmove(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void;
pub fn memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
pub fn strcat(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
pub fn strchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
pub fn strcmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
pub fn strcoll(arg1: *const c_char, arg2: *const c_char) -> c_int;
pub fn strcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
pub fn strcspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
pub fn strerror(arg1: c_int) -> *mut c_char;
pub fn strlen(arg1: *const c_char) -> size_t;
pub fn strncat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
pub fn strncmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
pub fn strncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
pub fn strpbrk(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
pub fn strrchr(arg1: *const c_char, arg2: c_int) -> *mut c_char;
pub fn strspn(arg1: *const c_char, arg2: *const c_char) -> size_t;
pub fn strstr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
pub fn strtok(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
pub fn strtok_r(arg1: *mut c_char, arg2: *const c_char, arg3: *mut *mut c_char) -> *mut c_char;
pub fn strerror_r(arg1: c_int, arg2: *mut c_char, arg3: size_t) -> c_int;
pub fn strxfrm(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
pub fn memccpy(
arg1: *mut c_void,
arg2: *const c_void,
arg3: c_int,
arg4: size_t,
) -> *mut c_void;
pub fn strdup(arg1: *const c_char) -> *mut c_char;
pub fn stpcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char;
pub fn stpncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char;
pub fn strnlen(arg1: *const c_char, arg2: size_t) -> size_t;
pub fn memmem(
arg1: *const c_void,
arg2: size_t,
arg3: *const c_void,
arg4: size_t,
) -> *mut c_void;
pub fn strcasestr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char;
pub fn strlcat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
pub fn strlcpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t;
pub fn strsep(arg1: *mut *mut c_char, arg2: *const c_char) -> *mut c_char;
pub fn stresep(arg1: *mut *mut c_char, arg2: *const c_char, arg3: c_int) -> *mut c_char;
pub fn strndup(arg1: *const c_char, arg2: size_t) -> *mut c_char;
pub fn memrchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
pub fn explicit_memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void;
pub fn consttime_memequal(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
pub fn strcoll_l(arg1: *const c_char, arg2: *const c_char, arg3: locale_t) -> c_int;
pub fn strxfrm_l(
arg1: *mut c_char,
arg2: *const c_char,
arg3: size_t,
arg4: locale_t,
) -> size_t;
pub fn strerror_l(arg1: c_int, arg2: locale_t) -> *mut c_char;
// strings.h
pub fn bcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int;
pub fn bcopy(arg1: *const c_void, arg2: *mut c_void, arg3: size_t);
pub fn bzero(arg1: *mut c_void, arg2: size_t);
pub fn ffs(arg1: c_int) -> c_int;
pub fn popcount(arg1: c_uint) -> c_uint;
pub fn popcountl(arg1: c_ulong) -> c_uint;
pub fn popcountll(arg1: c_ulonglong) -> c_uint;
pub fn popcount32(arg1: u32) -> c_uint;
pub fn popcount64(arg1: u64) -> c_uint;
pub fn rindex(arg1: *const c_char, arg2: c_int) -> *mut c_char;
pub fn strcasecmp(arg1: *const c_char, arg2: *const c_char) -> c_int;
pub fn strncasecmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int;
// signal.h
pub fn signal(arg1: c_int, arg2: sighandler_t) -> sighandler_t;
pub fn raise(arg1: c_int) -> c_int;
// time.h
pub fn asctime(arg1: *const tm) -> *mut c_char;
pub fn clock() -> clock_t;
pub fn ctime(arg1: *const time_t) -> *mut c_char;
pub fn difftime(arg1: time_t, arg2: time_t) -> f64;
pub fn gmtime(arg1: *const time_t) -> *mut tm;
pub fn localtime(arg1: *const time_t) -> *mut tm;
pub fn time(arg1: *mut time_t) -> time_t;
pub fn mktime(arg1: *mut tm) -> time_t;
pub fn strftime(
arg1: *mut c_char,
arg2: size_t,
arg3: *const c_char,
arg4: *const tm,
) -> size_t;
pub fn utime(arg1: *const c_char, arg2: *mut time_t) -> c_int;
pub fn asctime_r(arg1: *const tm, arg2: *mut c_char) -> *mut c_char;
pub fn ctime_r(arg1: *const time_t, arg2: *mut c_char) -> *mut c_char;
pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm;
// sys/stat.h
pub fn stat(arg1: *const c_char, arg2: *mut stat) -> c_int;
pub fn lstat(arg1: *const c_char, arg2: *mut stat) -> c_int;
pub fn fstat(arg1: c_int, arg2: *mut stat) -> c_int;
pub fn chmod(arg1: *const c_char, arg2: __mode_t) -> c_int;
pub fn mkdir(arg1: *const c_char, arg2: __mode_t) -> c_int;
// fcntl.h
pub fn open(arg1: *const c_char, arg2: c_int, ...) -> c_int;
pub fn creat(arg1: *const c_char, arg2: c_int) -> c_int;
pub fn close(arg1: c_int) -> c_int;
pub fn read(arg1: c_int, arg2: *mut c_void, arg3: c_int) -> c_int;
pub fn write(arg1: c_int, arg2: *const c_void, arg3: c_int) -> c_int;
pub fn unlink(arg1: *const c_char) -> c_int;
pub fn tell(arg1: c_int) -> c_long;
pub fn dup(arg1: c_int) -> c_int;
pub fn dup2(arg1: c_int, arg2: c_int) -> c_int;
pub fn access(arg1: *const c_char, arg2: c_int) -> c_int;
pub fn rmdir(arg1: *const c_char) -> c_int;
pub fn chdir(arg1: *const c_char) -> c_int;
pub fn _exit(arg1: c_int);
pub fn getwd(arg1: *mut c_char) -> *mut c_char;
pub fn getcwd(arg1: *mut c_char, arg2: size_t) -> *mut c_char;
pub static mut optarg: *mut c_char;
pub static mut opterr: c_int;
pub static mut optind: c_int;
pub static mut optopt: c_int;
pub static mut optreset: c_int;
pub fn getopt(arg1: c_int, arg2: *mut *mut c_char, arg3: *const c_char) -> c_int;
pub static mut suboptarg: *mut c_char;
pub fn getsubopt(
arg1: *mut *mut c_char,
arg2: *const *mut c_char,
arg3: *mut *mut c_char,
) -> c_int;
pub fn fcntl(arg1: c_int, arg2: c_int, ...) -> c_int;
pub fn getpid() -> pid_t;
pub fn sleep(arg1: c_uint) -> c_uint;
pub fn usleep(arg1: useconds_t) -> c_int;
// locale.h
pub fn localeconv() -> *mut lconv;
pub fn setlocale(arg1: c_int, arg2: *const c_char) -> *mut c_char;
pub fn duplocale(arg1: locale_t) -> locale_t;
pub fn freelocale(arg1: locale_t);
pub fn localeconv_l(arg1: locale_t) -> *mut lconv;
pub fn newlocale(arg1: c_int, arg2: *const c_char, arg3: locale_t) -> locale_t;
// langinfo.h
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn nl_langinfo_l(item: ::nl_item, locale: locale_t) -> *mut ::c_char;
// malloc.h
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
// sys/types.h
pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t;
}
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(any(target_arch = "arm"))] {
mod arm;
pub use self::arm::*;
} else {
// Unknown target_arch
}
}
libc-0.2.152/src/switch.rs 0000644 0000000 0000000 00000002362 10461020230 0013345 0 ustar 0000000 0000000 //! Switch C type definitions
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type off_t = i64;
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = u32;
pub const INT_MIN: c_int = -2147483648;
pub const INT_MAX: c_int = 2147483647;
cfg_if! {
if #[cfg(libc_core_cvoid)] {
pub use ::ffi::c_void;
} else {
// Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
// enable more optimization opportunities around it recognizing things
// like malloc/free.
#[repr(u8)]
#[allow(missing_copy_implementations)]
#[allow(missing_debug_implementations)]
pub enum c_void {
// Two dummy variants so the #[repr] attribute can be used.
#[doc(hidden)]
__variant1,
#[doc(hidden)]
__variant2,
}
}
}
libc-0.2.152/src/teeos/mod.rs 0000644 0000000 0000000 00000073205 10461020230 0013746 0 ustar 0000000 0000000 //! Libc bindings for teeos
//!
//! Apparently the loader just dynamically links it anyway, but fails
//! when linking is explicitly requested.
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
// only supported on Rust > 1.59, so we can directly reexport c_void from core.
pub use core::ffi::c_void;
use Option;
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_bool = i32;
pub type c_float = f32;
pub type c_double = f64;
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type intmax_t = i64;
pub type uintmax_t = u64;
pub type size_t = usize;
pub type ptrdiff_t = isize;
pub type intptr_t = isize;
pub type uintptr_t = usize;
pub type ssize_t = isize;
pub type pid_t = c_int;
// aarch64 specifc
pub type c_char = u8;
pub type wchar_t = u32;
pub type c_long = i64;
pub type c_ulong = u64;
#[repr(align(16))]
pub struct _CLongDouble(pub u128);
// long double in C means A float point value, which has 128bit length.
// but some bit maybe not used, so the really length of long double could be 80(x86) or 128(power pc/IEEE)
// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C).
// this is unstable and will couse to memfault/data abort.
pub type c_longdouble = _CLongDouble;
pub type pthread_t = c_ulong;
pub type pthread_key_t = c_uint;
pub type pthread_spinlock_t = c_int;
pub type off_t = i64;
pub type time_t = c_long;
pub type clock_t = c_long;
pub type clockid_t = c_int;
pub type suseconds_t = c_long;
pub type once_fn = extern "C" fn() -> c_void;
pub type pthread_once_t = c_int;
pub type va_list = *mut c_char;
pub type wint_t = c_uint;
pub type wctype_t = c_ulong;
pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int;
#[repr(align(8))]
#[repr(C)]
pub struct pthread_cond_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_COND_T],
}
#[repr(align(8))]
#[repr(C)]
pub struct pthread_mutex_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEX_T],
}
#[repr(align(4))]
#[repr(C)]
pub struct pthread_mutexattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
}
#[repr(align(4))]
#[repr(C)]
pub struct pthread_condattr_t {
#[doc(hidden)]
size: [u8; __SIZEOF_PTHREAD_CONDATTR_T],
}
#[repr(C)]
pub struct pthread_attr_t {
__size: [u64; 7],
}
#[repr(C)]
pub struct cpu_set_t {
bits: [c_ulong; 128 / core::mem::size_of::()],
}
#[repr(C)]
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
#[repr(C)]
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[repr(C)]
pub struct tm {
pub tm_sec: c_int,
pub tm_min: c_int,
pub tm_hour: c_int,
pub tm_mday: c_int,
pub tm_mon: c_int,
pub tm_year: c_int,
pub tm_wday: c_int,
pub tm_yday: c_int,
pub tm_isdst: c_int,
pub __tm_gmtoff: c_long,
pub __tm_zone: *const c_char,
}
#[repr(C)]
pub struct mbstate_t {
pub __opaque1: c_uint,
pub __opaque2: c_uint,
}
#[repr(C)]
pub struct sem_t {
pub __val: [c_int; 4 * core::mem::size_of::() / core::mem::size_of::()],
}
#[repr(C)]
pub struct div_t {
pub quot: c_int,
pub rem: c_int,
}
// fcntl
pub const O_CREAT: u32 = 0100;
pub const O_EXCL: u32 = 0200;
pub const O_NOCTTY: u32 = 0400;
pub const O_TRUNC: u32 = 01000;
pub const O_APPEND: u32 = 02000;
pub const O_NONBLOCK: u32 = 04000;
pub const O_DSYNC: u32 = 010000;
pub const O_SYNC: u32 = 04010000;
pub const O_RSYNC: u32 = 04010000;
pub const O_DIRECTORY: u32 = 0200000;
pub const O_NOFOLLOW: u32 = 0400000;
pub const O_CLOEXEC: u32 = 02000000;
pub const O_ASYNC: u32 = 020000;
pub const O_DIRECT: u32 = 040000;
pub const O_LARGEFILE: u32 = 0100000;
pub const O_NOATIME: u32 = 01000000;
pub const O_PATH: u32 = 010000000;
pub const O_TMPFILE: u32 = 020200000;
pub const O_NDELAY: u32 = O_NONBLOCK;
pub const F_DUPFD: u32 = 0;
pub const F_GETFD: u32 = 1;
pub const F_SETFD: u32 = 2;
pub const F_GETFL: u32 = 3;
pub const F_SETFL: u32 = 4;
pub const F_SETOWN: u32 = 8;
pub const F_GETOWN: u32 = 9;
pub const F_SETSIG: u32 = 10;
pub const F_GETSIG: u32 = 11;
pub const F_GETLK: u32 = 12;
pub const F_SETLK: u32 = 13;
pub const F_SETLKW: u32 = 14;
pub const F_SETOWN_EX: u32 = 15;
pub const F_GETOWN_EX: u32 = 16;
pub const F_GETOWNER_UIDS: u32 = 17;
// mman
pub const MAP_FAILED: u64 = 0xffffffffffffffff;
pub const MAP_FIXED_NOREPLACE: u32 = 0x100000;
pub const MAP_SHARED_VALIDATE: u32 = 0x03;
pub const MAP_SHARED: u32 = 0x01;
pub const MAP_PRIVATE: u32 = 0x02;
pub const MAP_TYPE: u32 = 0x0f;
pub const MAP_FIXED: u32 = 0x10;
pub const MAP_ANON: u32 = 0x20;
pub const MAP_ANONYMOUS: u32 = MAP_ANON;
pub const MAP_NORESERVE: u32 = 0x4000;
pub const MAP_GROWSDOWN: u32 = 0x0100;
pub const MAP_DENYWRITE: u32 = 0x0800;
pub const MAP_EXECUTABLE: u32 = 0x1000;
pub const MAP_LOCKED: u32 = 0x2000;
pub const MAP_POPULATE: u32 = 0x8000;
pub const MAP_NONBLOCK: u32 = 0x10000;
pub const MAP_STACK: u32 = 0x20000;
pub const MAP_HUGETLB: u32 = 0x40000;
pub const MAP_SYNC: u32 = 0x80000;
pub const MAP_FILE: u32 = 0;
pub const MAP_HUGE_SHIFT: u32 = 26;
pub const MAP_HUGE_MASK: u32 = 0x3f;
pub const MAP_HUGE_16KB: u32 = 14 << 26;
pub const MAP_HUGE_64KB: u32 = 16 << 26;
pub const MAP_HUGE_512KB: u32 = 19 << 26;
pub const MAP_HUGE_1MB: u32 = 20 << 26;
pub const MAP_HUGE_2MB: u32 = 21 << 26;
pub const MAP_HUGE_8MB: u32 = 23 << 26;
pub const MAP_HUGE_16MB: u32 = 24 << 26;
pub const MAP_HUGE_32MB: u32 = 25 << 26;
pub const MAP_HUGE_256MB: u32 = 28 << 26;
pub const MAP_HUGE_512MB: u32 = 29 << 26;
pub const MAP_HUGE_1GB: u32 = 30 << 26;
pub const MAP_HUGE_2GB: u32 = 31 << 26;
pub const MAP_HUGE_16GB: u32 = 34u32 << 26;
pub const PROT_NONE: u32 = 0;
pub const PROT_READ: u32 = 1;
pub const PROT_WRITE: u32 = 2;
pub const PROT_EXEC: u32 = 4;
pub const PROT_GROWSDOWN: u32 = 0x01000000;
pub const PROT_GROWSUP: u32 = 0x02000000;
pub const MS_ASYNC: u32 = 1;
pub const MS_INVALIDATE: u32 = 2;
pub const MS_SYNC: u32 = 4;
pub const MCL_CURRENT: u32 = 1;
pub const MCL_FUTURE: u32 = 2;
pub const MCL_ONFAULT: u32 = 4;
pub const POSIX_MADV_NORMAL: u32 = 0;
pub const POSIX_MADV_RANDOM: u32 = 1;
pub const POSIX_MADV_SEQUENTIAL: u32 = 2;
pub const POSIX_MADV_WILLNEED: u32 = 3;
pub const POSIX_MADV_DONTNEED: u32 = 4;
// wctype
pub const WCTYPE_ALNUM: u64 = 1;
pub const WCTYPE_ALPHA: u64 = 2;
pub const WCTYPE_BLANK: u64 = 3;
pub const WCTYPE_CNTRL: u64 = 4;
pub const WCTYPE_DIGIT: u64 = 5;
pub const WCTYPE_GRAPH: u64 = 6;
pub const WCTYPE_LOWER: u64 = 7;
pub const WCTYPE_PRINT: u64 = 8;
pub const WCTYPE_PUNCT: u64 = 9;
pub const WCTYPE_SPACE: u64 = 10;
pub const WCTYPE_UPPER: u64 = 11;
pub const WCTYPE_XDIGIT: u64 = 12;
// locale
pub const LC_CTYPE: i32 = 0;
pub const LC_NUMERIC: i32 = 1;
pub const LC_TIME: i32 = 2;
pub const LC_COLLATE: i32 = 3;
pub const LC_MONETARY: i32 = 4;
pub const LC_MESSAGES: i32 = 5;
pub const LC_ALL: i32 = 6;
// pthread
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40;
pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4;
pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4;
// errno.h
pub const EPERM: c_int = 1;
pub const ENOENT: c_int = 2;
pub const ESRCH: c_int = 3;
pub const EINTR: c_int = 4;
pub const EIO: c_int = 5;
pub const ENXIO: c_int = 6;
pub const E2BIG: c_int = 7;
pub const ENOEXEC: c_int = 8;
pub const EBADF: c_int = 9;
pub const ECHILD: c_int = 10;
pub const EAGAIN: c_int = 11;
pub const ENOMEM: c_int = 12;
pub const EACCES: c_int = 13;
pub const EFAULT: c_int = 14;
pub const ENOTBLK: c_int = 15;
pub const EBUSY: c_int = 16;
pub const EEXIST: c_int = 17;
pub const EXDEV: c_int = 18;
pub const ENODEV: c_int = 19;
pub const ENOTDIR: c_int = 20;
pub const EISDIR: c_int = 21;
pub const EINVAL: c_int = 22;
pub const ENFILE: c_int = 23;
pub const EMFILE: c_int = 24;
pub const ENOTTY: c_int = 25;
pub const ETXTBSY: c_int = 26;
pub const EFBIG: c_int = 27;
pub const ENOSPC: c_int = 28;
pub const ESPIPE: c_int = 29;
pub const EROFS: c_int = 30;
pub const EMLINK: c_int = 31;
pub const EPIPE: c_int = 32;
pub const EDOM: c_int = 33;
pub const ERANGE: c_int = 34;
pub const EDEADLK: c_int = 35;
pub const ENAMETOOLONG: c_int = 36;
pub const ENOLCK: c_int = 37;
pub const ENOSYS: c_int = 38;
pub const ENOTEMPTY: c_int = 39;
pub const ELOOP: c_int = 40;
pub const EWOULDBLOCK: c_int = EAGAIN;
pub const ENOMSG: c_int = 42;
pub const EIDRM: c_int = 43;
pub const ECHRNG: c_int = 44;
pub const EL2NSYNC: c_int = 45;
pub const EL3HLT: c_int = 46;
pub const EL3RST: c_int = 47;
pub const ELNRNG: c_int = 48;
pub const EUNATCH: c_int = 49;
pub const ENOCSI: c_int = 50;
pub const EL2HLT: c_int = 51;
pub const EBADE: c_int = 52;
pub const EBADR: c_int = 53;
pub const EXFULL: c_int = 54;
pub const ENOANO: c_int = 55;
pub const EBADRQC: c_int = 56;
pub const EBADSLT: c_int = 57;
pub const EDEADLOCK: c_int = EDEADLK;
pub const EBFONT: c_int = 59;
pub const ENOSTR: c_int = 60;
pub const ENODATA: c_int = 61;
pub const ETIME: c_int = 62;
pub const ENOSR: c_int = 63;
pub const ENONET: c_int = 64;
pub const ENOPKG: c_int = 65;
pub const EREMOTE: c_int = 66;
pub const ENOLINK: c_int = 67;
pub const EADV: c_int = 68;
pub const ESRMNT: c_int = 69;
pub const ECOMM: c_int = 70;
pub const EPROTO: c_int = 71;
pub const EMULTIHOP: c_int = 72;
pub const EDOTDOT: c_int = 73;
pub const EBADMSG: c_int = 74;
pub const EOVERFLOW: c_int = 75;
pub const ENOTUNIQ: c_int = 76;
pub const EBADFD: c_int = 77;
pub const EREMCHG: c_int = 78;
pub const ELIBACC: c_int = 79;
pub const ELIBBAD: c_int = 80;
pub const ELIBSCN: c_int = 81;
pub const ELIBMAX: c_int = 82;
pub const ELIBEXEC: c_int = 83;
pub const EILSEQ: c_int = 84;
pub const ERESTART: c_int = 85;
pub const ESTRPIPE: c_int = 86;
pub const EUSERS: c_int = 87;
pub const ENOTSOCK: c_int = 88;
pub const EDESTADDRREQ: c_int = 89;
pub const EMSGSIZE: c_int = 90;
pub const EPROTOTYPE: c_int = 91;
pub const ENOPROTOOPT: c_int = 92;
pub const EPROTONOSUPPOR: c_int = 93;
pub const ESOCKTNOSUPPOR: c_int = 94;
pub const EOPNOTSUPP: c_int = 95;
pub const ENOTSUP: c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: c_int = 96;
pub const EAFNOSUPPORT: c_int = 97;
pub const EADDRINUSE: c_int = 98;
pub const EADDRNOTAVAIL: c_int = 99;
pub const ENETDOWN: c_int = 100;
pub const ENETUNREACH: c_int = 101;
pub const ENETRESET: c_int = 102;
pub const ECONNABORTED: c_int = 103;
pub const ECONNRESET: c_int = 104;
pub const ENOBUFS: c_int = 105;
pub const EISCONN: c_int = 106;
pub const ENOTCONN: c_int = 107;
pub const ESHUTDOWN: c_int = 108;
pub const ETOOMANYREFS: c_int = 109;
pub const ETIMEDOUT: c_int = 110;
pub const ECONNREFUSED: c_int = 111;
pub const EHOSTDOWN: c_int = 112;
pub const EHOSTUNREACH: c_int = 113;
pub const EALREADY: c_int = 114;
pub const EINPROGRESS: c_int = 115;
pub const ESTALE: c_int = 116;
pub const EUCLEAN: c_int = 117;
pub const ENOTNAM: c_int = 118;
pub const ENAVAIL: c_int = 119;
pub const EISNAM: c_int = 120;
pub const EREMOTEIO: c_int = 121;
pub const EDQUOT: c_int = 122;
pub const ENOMEDIUM: c_int = 123;
pub const EMEDIUMTYPE: c_int = 124;
pub const ECANCELED: c_int = 125;
pub const ENOKEY: c_int = 126;
pub const EKEYEXPIRED: c_int = 127;
pub const EKEYREVOKED: c_int = 128;
pub const EKEYREJECTED: c_int = 129;
pub const EOWNERDEAD: c_int = 130;
pub const ENOTRECOVERABLE: c_int = 131;
pub const ERFKILL: c_int = 132;
pub const EHWPOISON: c_int = 133;
// pthread_attr.h
pub const TEESMP_THREAD_ATTR_CA_WILDCARD: c_int = 0;
pub const TEESMP_THREAD_ATTR_CA_INHERIT: c_int = -1;
pub const TEESMP_THREAD_ATTR_TASK_ID_INHERIT: c_int = -1;
pub const TEESMP_THREAD_ATTR_HAS_SHADOW: c_int = 0x1;
pub const TEESMP_THREAD_ATTR_NO_SHADOW: c_int = 0x0;
// unistd.h
pub const _SC_ARG_MAX: c_int = 0;
pub const _SC_CHILD_MAX: c_int = 1;
pub const _SC_CLK_TCK: c_int = 2;
pub const _SC_NGROUPS_MAX: c_int = 3;
pub const _SC_OPEN_MAX: c_int = 4;
pub const _SC_STREAM_MAX: c_int = 5;
pub const _SC_TZNAME_MAX: c_int = 6;
pub const _SC_JOB_CONTROL: c_int = 7;
pub const _SC_SAVED_IDS: c_int = 8;
pub const _SC_REALTIME_SIGNALS: c_int = 9;
pub const _SC_PRIORITY_SCHEDULING: c_int = 10;
pub const _SC_TIMERS: c_int = 11;
pub const _SC_ASYNCHRONOUS_IO: c_int = 12;
pub const _SC_PRIORITIZED_IO: c_int = 13;
pub const _SC_SYNCHRONIZED_IO: c_int = 14;
pub const _SC_FSYNC: c_int = 15;
pub const _SC_MAPPED_FILES: c_int = 16;
pub const _SC_MEMLOCK: c_int = 17;
pub const _SC_MEMLOCK_RANGE: c_int = 18;
pub const _SC_MEMORY_PROTECTION: c_int = 19;
pub const _SC_MESSAGE_PASSING: c_int = 20;
pub const _SC_SEMAPHORES: c_int = 21;
pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22;
pub const _SC_AIO_LISTIO_MAX: c_int = 23;
pub const _SC_AIO_MAX: c_int = 24;
pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25;
pub const _SC_DELAYTIMER_MAX: c_int = 26;
pub const _SC_MQ_OPEN_MAX: c_int = 27;
pub const _SC_MQ_PRIO_MAX: c_int = 28;
pub const _SC_VERSION: c_int = 29;
pub const _SC_PAGE_SIZE: c_int = 30;
pub const _SC_PAGESIZE: c_int = 30; /* !! */
pub const _SC_RTSIG_MAX: c_int = 31;
pub const _SC_SEM_NSEMS_MAX: c_int = 32;
pub const _SC_SEM_VALUE_MAX: c_int = 33;
pub const _SC_SIGQUEUE_MAX: c_int = 34;
pub const _SC_TIMER_MAX: c_int = 35;
pub const _SC_BC_BASE_MAX: c_int = 36;
pub const _SC_BC_DIM_MAX: c_int = 37;
pub const _SC_BC_SCALE_MAX: c_int = 38;
pub const _SC_BC_STRING_MAX: c_int = 39;
pub const _SC_COLL_WEIGHTS_MAX: c_int = 40;
pub const _SC_EXPR_NEST_MAX: c_int = 42;
pub const _SC_LINE_MAX: c_int = 43;
pub const _SC_RE_DUP_MAX: c_int = 44;
pub const _SC_2_VERSION: c_int = 46;
pub const _SC_2_C_BIND: c_int = 47;
pub const _SC_2_C_DEV: c_int = 48;
pub const _SC_2_FORT_DEV: c_int = 49;
pub const _SC_2_FORT_RUN: c_int = 50;
pub const _SC_2_SW_DEV: c_int = 51;
pub const _SC_2_LOCALEDEF: c_int = 52;
pub const _SC_UIO_MAXIOV: c_int = 60; /* !! */
pub const _SC_IOV_MAX: c_int = 60;
pub const _SC_THREADS: c_int = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68;
pub const _SC_GETGR_R_SIZE_MAX: c_int = 69;
pub const _SC_GETPW_R_SIZE_MAX: c_int = 70;
pub const _SC_LOGIN_NAME_MAX: c_int = 71;
pub const _SC_TTY_NAME_MAX: c_int = 72;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73;
pub const _SC_THREAD_KEYS_MAX: c_int = 74;
pub const _SC_THREAD_STACK_MIN: c_int = 75;
pub const _SC_THREAD_THREADS_MAX: c_int = 76;
pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77;
pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78;
pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79;
pub const _SC_THREAD_PRIO_INHERIT: c_int = 80;
pub const _SC_THREAD_PRIO_PROTECT: c_int = 81;
pub const _SC_THREAD_PROCESS_SHARED: c_int = 82;
pub const _SC_NPROCESSORS_CONF: c_int = 83;
pub const _SC_NPROCESSORS_ONLN: c_int = 84;
pub const _SC_PHYS_PAGES: c_int = 85;
pub const _SC_AVPHYS_PAGES: c_int = 86;
pub const _SC_ATEXIT_MAX: c_int = 87;
pub const _SC_PASS_MAX: c_int = 88;
pub const _SC_XOPEN_VERSION: c_int = 89;
pub const _SC_XOPEN_XCU_VERSION: c_int = 90;
pub const _SC_XOPEN_UNIX: c_int = 91;
pub const _SC_XOPEN_CRYPT: c_int = 92;
pub const _SC_XOPEN_ENH_I18N: c_int = 93;
pub const _SC_XOPEN_SHM: c_int = 94;
pub const _SC_2_CHAR_TERM: c_int = 95;
pub const _SC_2_UPE: c_int = 97;
pub const _SC_XOPEN_XPG2: c_int = 98;
pub const _SC_XOPEN_XPG3: c_int = 99;
pub const _SC_XOPEN_XPG4: c_int = 100;
pub const _SC_NZERO: c_int = 109;
pub const _SC_XBS5_ILP32_OFF32: c_int = 125;
pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126;
pub const _SC_XBS5_LP64_OFF64: c_int = 127;
pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128;
pub const _SC_XOPEN_LEGACY: c_int = 129;
pub const _SC_XOPEN_REALTIME: c_int = 130;
pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131;
pub const _SC_ADVISORY_INFO: c_int = 132;
pub const _SC_BARRIERS: c_int = 133;
pub const _SC_CLOCK_SELECTION: c_int = 137;
pub const _SC_CPUTIME: c_int = 138;
pub const _SC_THREAD_CPUTIME: c_int = 139;
pub const _SC_MONOTONIC_CLOCK: c_int = 149;
pub const _SC_READER_WRITER_LOCKS: c_int = 153;
pub const _SC_SPIN_LOCKS: c_int = 154;
pub const _SC_REGEXP: c_int = 155;
pub const _SC_SHELL: c_int = 157;
pub const _SC_SPAWN: c_int = 159;
pub const _SC_SPORADIC_SERVER: c_int = 160;
pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161;
pub const _SC_TIMEOUTS: c_int = 164;
pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165;
pub const _SC_2_PBS: c_int = 168;
pub const _SC_2_PBS_ACCOUNTING: c_int = 169;
pub const _SC_2_PBS_LOCATE: c_int = 170;
pub const _SC_2_PBS_MESSAGE: c_int = 171;
pub const _SC_2_PBS_TRACK: c_int = 172;
pub const _SC_SYMLOOP_MAX: c_int = 173;
pub const _SC_STREAMS: c_int = 174;
pub const _SC_2_PBS_CHECKPOINT: c_int = 175;
pub const _SC_V6_ILP32_OFF32: c_int = 176;
pub const _SC_V6_ILP32_OFFBIG: c_int = 177;
pub const _SC_V6_LP64_OFF64: c_int = 178;
pub const _SC_V6_LPBIG_OFFBIG: c_int = 179;
pub const _SC_HOST_NAME_MAX: c_int = 180;
pub const _SC_TRACE: c_int = 181;
pub const _SC_TRACE_EVENT_FILTER: c_int = 182;
pub const _SC_TRACE_INHERIT: c_int = 183;
pub const _SC_TRACE_LOG: c_int = 184;
pub const _SC_IPV6: c_int = 235;
pub const _SC_RAW_SOCKETS: c_int = 236;
pub const _SC_V7_ILP32_OFF32: c_int = 237;
pub const _SC_V7_ILP32_OFFBIG: c_int = 238;
pub const _SC_V7_LP64_OFF64: c_int = 239;
pub const _SC_V7_LPBIG_OFFBIG: c_int = 240;
pub const _SC_SS_REPL_MAX: c_int = 241;
pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242;
pub const _SC_TRACE_NAME_MAX: c_int = 243;
pub const _SC_TRACE_SYS_MAX: c_int = 244;
pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245;
pub const _SC_XOPEN_STREAMS: c_int = 246;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248;
// limits.h
pub const PTHREAD_KEYS_MAX: c_int = 128;
pub const PTHREAD_STACK_MIN: c_int = 2048;
pub const PTHREAD_DESTRUCTOR_ITERATIONS: c_int = 4;
pub const SEM_VALUE_MAX: c_int = 0x7fffffff;
pub const SEM_NSEMS_MAX: c_int = 256;
pub const DELAYTIMER_MAX: c_int = 0x7fffffff;
pub const MQ_PRIO_MAX: c_int = 32768;
pub const LOGIN_NAME_MAX: c_int = 256;
// time.h
pub const CLOCK_REALTIME: clockid_t = 0;
pub const CLOCK_MONOTONIC: clockid_t = 1;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
size: [0; __SIZEOF_PTHREAD_MUTEX_T],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
size: [0; __SIZEOF_PTHREAD_COND_T],
};
pub const PTHREAD_MUTEX_NORMAL: c_int = 0;
pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1;
pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL;
pub const PTHREAD_MUTEX_STALLED: c_int = 0;
pub const PTHREAD_MUTEX_ROBUST: c_int = 1;
extern "C" {
// ---- ALLOC -----------------------------------------------------------------------------
pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void;
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
pub fn aligned_alloc(align: size_t, len: size_t) -> *mut c_void;
pub fn free(p: *mut c_void);
pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int;
pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t;
pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void;
pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void;
// ----- PTHREAD ---------------------------------------------------------------------------
pub fn pthread_self() -> pthread_t;
pub fn pthread_join(native: pthread_t, value: *mut *mut c_void) -> c_int;
// detach or pthread_attr_setdetachstate must not be called!
//pub fn pthread_detach(thread: pthread_t) -> c_int;
pub fn pthread_exit(value: *mut c_void) -> !;
pub fn pthread_attr_init(attr: *mut pthread_attr_t) -> c_int;
pub fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int;
pub fn pthread_attr_getstack(
attr: *const pthread_attr_t,
stackaddr: *mut *mut c_void,
stacksize: *mut size_t,
) -> c_int;
pub fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stack_size: size_t) -> c_int;
pub fn pthread_attr_getstacksize(attr: *const pthread_attr_t, size: *mut size_t) -> c_int;
pub fn pthread_attr_settee(
attr: *mut pthread_attr_t,
ca: c_int,
task_id: c_int,
shadow: c_int,
) -> c_int;
// C-TA API do not include this interface, but TA can use.
pub fn sched_yield() -> c_int;
pub fn pthread_key_create(
key: *mut pthread_key_t,
dtor: Option,
) -> c_int;
pub fn pthread_key_delete(key: pthread_key_t) -> c_int;
pub fn pthread_getspecific(key: pthread_key_t) -> *mut c_void;
pub fn pthread_setspecific(key: pthread_key_t, value: *const c_void) -> c_int;
pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> c_int;
pub fn pthread_mutex_init(
lock: *mut pthread_mutex_t,
attr: *const pthread_mutexattr_t,
) -> c_int;
pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> c_int;
pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> c_int;
pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> c_int;
pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int;
pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int;
pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: c_int) -> c_int;
pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int;
pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int;
pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int;
pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int;
pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int;
pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int;
pub fn pthread_cond_timedwait(
cond: *mut pthread_cond_t,
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int;
pub fn pthread_create(
native: *mut pthread_t,
attr: *const pthread_attr_t,
f: extern "C" fn(*mut c_void) -> *mut c_void,
value: *mut c_void,
) -> c_int;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int;
pub fn pthread_setschedprio(native: pthread_t, priority: c_int) -> c_int;
pub fn pthread_once(pot: *mut pthread_once_t, f: Option) -> c_int;
pub fn pthread_equal(p1: pthread_t, p2: pthread_t) -> c_int;
pub fn pthread_mutexattr_setprotocol(a: *mut pthread_mutexattr_t, protocol: c_int) -> c_int;
pub fn pthread_attr_setstack(
attr: *mut pthread_attr_t,
stack: *mut c_void,
size: size_t,
) -> c_int;
pub fn pthread_setaffinity_np(td: pthread_t, size: size_t, set: *const cpu_set_t) -> c_int;
pub fn pthread_getaffinity_np(td: pthread_t, size: size_t, set: *mut cpu_set_t) -> c_int;
// stdio.h
pub fn printf(fmt: *const c_char, ...) -> c_int;
pub fn scanf(fmt: *const c_char, ...) -> c_int;
pub fn snprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ...) -> c_int;
pub fn sprintf(s: *mut c_char, fmt: *const c_char, ...) -> c_int;
pub fn vsnprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ap: va_list) -> c_int;
pub fn vsprintf(s: *mut c_char, fmt: *const c_char, ap: va_list) -> c_int;
// Not available.
//pub fn pthread_setname_np(thread: pthread_t, name: *const c_char) -> c_int;
pub fn abort() -> !;
// Not available.
//pub fn prctl(op: c_int, ...) -> c_int;
pub fn sched_getaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *mut cpu_set_t) -> c_int;
pub fn sched_setaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *const cpu_set_t) -> c_int;
// sysconf is currently only implemented as a stub.
pub fn sysconf(name: c_int) -> c_long;
// mman.h
pub fn mmap(
addr: *mut c_void,
len: size_t,
prot: c_int,
flags: c_int,
fd: c_int,
offset: off_t,
) -> *mut c_void;
pub fn munmap(addr: *mut c_void, len: size_t) -> c_int;
// errno.h
pub fn __errno_location() -> *mut c_int;
pub fn strerror(e: c_int) -> *mut c_char;
// time.h
pub fn clock_gettime(clock_id: clockid_t, tp: *mut timespec) -> c_int;
// unistd
pub fn getpid() -> pid_t;
// time
pub fn gettimeofday(tv: *mut timeval, tz: *mut c_void) -> c_int;
pub fn strftime(
restrict: *mut c_char,
sz: size_t,
_restrict: *const c_char,
__restrict: *const tm,
) -> size_t;
pub fn time(t: *mut time_t) -> time_t;
// sem
pub fn sem_close(sem: *mut sem_t) -> c_int;
pub fn sem_destroy(sem: *mut sem_t) -> c_int;
pub fn sem_getvalue(sem: *mut sem_t, valp: *mut c_int) -> c_int;
pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int;
pub fn sem_open(name: *const c_char, flags: c_int, ...) -> *mut sem_t;
pub fn sem_post(sem: *mut sem_t) -> c_int;
pub fn sem_unlink(name: *const c_char) -> c_int;
pub fn sem_wait(sem: *mut sem_t) -> c_int;
// locale
pub fn setlocale(cat: c_int, name: *const c_char) -> *mut c_char;
pub fn strcoll(l: *const c_char, r: *const c_char) -> c_int;
pub fn strxfrm(dest: *mut c_char, src: *const c_char, n: size_t) -> size_t;
pub fn strtod(s: *const c_char, p: *mut *mut c_char) -> c_double;
// multibyte
pub fn mbrtowc(wc: *mut wchar_t, src: *const c_char, n: size_t, st: *mut mbstate_t) -> size_t;
pub fn wcrtomb(s: *mut c_char, wc: wchar_t, st: *mut mbstate_t) -> size_t;
pub fn wctob(c: wint_t) -> c_int;
// prng
pub fn srandom(seed: c_uint);
pub fn initstate(seed: c_uint, state: *mut c_char, size: size_t) -> *mut c_char;
pub fn setstate(state: *mut c_char) -> *mut c_char;
pub fn random() -> c_long;
// string
pub fn strchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn strcmp(l: *const c_char, r: *const c_char) -> c_int;
pub fn strcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char;
pub fn strncmp(_l: *const c_char, r: *const c_char, n: size_t) -> c_int;
pub fn strncpy(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char;
pub fn strnlen(cs: *const c_char, n: size_t) -> size_t;
pub fn strrchr(s: *const c_char, c: c_int) -> *mut c_char;
pub fn strstr(h: *const c_char, n: *const c_char) -> *mut c_char;
pub fn wcschr(s: *const wchar_t, c: wchar_t) -> *mut wchar_t;
pub fn wcslen(s: *const wchar_t) -> size_t;
// ctype
pub fn isalpha(c: c_int) -> c_int;
pub fn isascii(c: c_int) -> c_int;
pub fn isdigit(c: c_int) -> c_int;
pub fn islower(c: c_int) -> c_int;
pub fn isprint(c: c_int) -> c_int;
pub fn isspace(c: c_int) -> c_int;
pub fn iswctype(wc: wint_t, ttype: wctype_t) -> c_int;
pub fn iswdigit(wc: wint_t) -> c_int;
pub fn iswlower(wc: wint_t) -> c_int;
pub fn iswspace(wc: wint_t) -> c_int;
pub fn iswupper(wc: wint_t) -> c_int;
pub fn towupper(wc: wint_t) -> wint_t;
pub fn towlower(wc: wint_t) -> wint_t;
// cmath
pub fn atan(x: c_double) -> c_double;
pub fn ceil(x: c_double) -> c_double;
pub fn ceilf(x: c_float) -> c_float;
pub fn exp(x: c_double) -> c_double;
pub fn fabs(x: c_double) -> c_double;
pub fn floor(x: c_double) -> c_double;
pub fn frexp(x: c_double, e: *mut c_int) -> c_double;
pub fn log(x: c_double) -> c_double;
pub fn log2(x: c_double) -> c_double;
pub fn pow(x: c_double, y: c_double) -> c_double;
pub fn roundf(x: c_float) -> c_float;
pub fn scalbn(x: c_double, n: c_int) -> c_double;
pub fn sqrt(x: c_double) -> c_double;
// stdlib
pub fn abs(x: c_int) -> c_int;
pub fn atof(s: *const c_char) -> c_double;
pub fn atoi(s: *const c_char) -> c_int;
pub fn atol(s: *const c_char) -> c_long;
pub fn atoll(s: *const c_char) -> c_longlong;
pub fn bsearch(
key: *const c_void,
base: *const c_void,
nel: size_t,
width: size_t,
cmp: cmpfunc,
) -> *mut c_void;
pub fn div(num: c_int, den: c_int) -> div_t;
pub fn ecvt(x: c_double, n: c_int, dp: *mut c_int, sign: *mut c_int) -> *mut c_char;
pub fn imaxabs(a: intmax_t) -> intmax_t;
pub fn llabs(a: c_longlong) -> c_longlong;
pub fn qsort(base: *mut c_void, nel: size_t, width: size_t, cmp: cmpfunc);
pub fn strtoul(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_ulong;
pub fn strtol(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_long;
pub fn wcstod(s: *const wchar_t, p: *mut *mut wchar_t) -> c_double;
}
pub fn errno() -> c_int {
unsafe { *__errno_location() }
}
pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int {
let mut s: u32 = 0;
let size_of_mask = core::mem::size_of_val(&cpuset.bits[0]);
for i in cpuset.bits[..(size / size_of_mask)].iter() {
s += i.count_ones();
}
s as c_int
}
pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int {
CPU_COUNT_S(core::mem::size_of::(), cpuset)
}
libc-0.2.152/src/unix/aix/mod.rs 0000644 0000000 0000000 00000350126 10461020230 0014373 0 ustar 0000000 0000000 pub type c_char = i8;
pub type caddr_t = *mut ::c_char;
pub type clockid_t = ::c_longlong;
pub type blkcnt_t = ::c_long;
pub type clock_t = ::c_int;
pub type daddr_t = ::c_long;
pub type dev_t = ::c_ulong;
pub type fpos64_t = ::c_longlong;
pub type fsblkcnt_t = ::c_ulong;
pub type fsfilcnt_t = ::c_ulong;
pub type idtype_t = ::c_int;
pub type ino_t = ::c_ulong;
pub type key_t = ::c_int;
pub type mode_t = ::c_uint;
pub type nlink_t = ::c_short;
pub type rlim_t = ::c_ulong;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type time_t = ::c_long;
pub type time64_t = ::int64_t;
pub type timer_t = ::c_long;
pub type wchar_t = ::c_uint;
pub type nfds_t = ::c_int;
pub type projid_t = ::c_int;
pub type id_t = ::c_uint;
pub type blksize64_t = ::c_ulonglong;
pub type blkcnt64_t = ::c_ulonglong;
pub type sctp_assoc_t = ::uint32_t;
pub type suseconds_t = ::c_int;
pub type useconds_t = ::c_uint;
pub type off_t = ::c_long;
pub type off64_t = ::c_longlong;
pub type socklen_t = ::c_uint;
pub type sa_family_t = ::c_uchar;
pub type in_port_t = ::c_ushort;
pub type in_addr_t = ::c_uint;
pub type signal_t = ::c_int;
pub type pthread_t = ::c_uint;
pub type pthread_key_t = ::c_uint;
pub type thread_t = pthread_t;
pub type blksize_t = ::c_long;
pub type nl_item = ::c_int;
pub type mqd_t = ::c_int;
pub type shmatt_t = ::c_ulong;
pub type regoff_t = ::c_long;
pub type rlim64_t = ::c_ulonglong;
pub type sem_t = ::c_int;
pub type pollset_t = ::c_int;
pub type pthread_rwlockattr_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_barrierattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_char;
pub type iconv_t = *mut ::c_void;
e! {
pub enum uio_rw {
UIO_READ = 0,
UIO_WRITE,
UIO_READ_NO_MOVE,
UIO_WRITE_NO_MOVE,
UIO_PWRITE,
}
}
s! {
pub struct fsid_t {
pub val: [::c_uint; 2],
}
pub struct fsid64_t {
pub val: [::uint64_t; 2],
}
pub struct timezone {
pub tz_minuteswest: ::c_int,
pub tz_dsttime: ::c_int,
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct dirent {
pub d_offset: ::c_ulong,
pub d_ino: ::ino_t,
pub d_reclen: ::c_ushort,
pub d_namlen: ::c_ushort,
pub d_name: [::c_char; 256]
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_cc: [::cc_t; ::NCCS]
}
pub struct flock64 {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_sysid: ::c_uint,
pub l_pid: ::pid_t,
pub l_vfs: ::c_int,
pub l_start: ::off64_t,
pub l_len: ::off64_t,
}
pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: socklen_t,
pub msg_flags: ::c_int,
}
pub struct statvfs64 {
pub f_bsize: ::blksize64_t,
pub f_frsize: ::blksize64_t,
pub f_blocks: ::blkcnt64_t,
pub f_bfree: ::blkcnt64_t,
pub f_bavail: ::blkcnt64_t,
pub f_files: ::blkcnt64_t,
pub f_ffree: ::blkcnt64_t,
pub f_favail: ::blkcnt64_t,
pub f_fsid: fsid64_t,
pub f_basetype: [::c_char; 16],
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_fstr: [::c_char; 32],
pub f_filler: [::c_ulong; 16]
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub left_parenthesis: *mut ::c_char,
pub right_parenthesis: *mut ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct tm {
pub tm_sec: ::c_int,
pub tm_min: ::c_int,
pub tm_hour: ::c_int,
pub tm_mday: ::c_int,
pub tm_mon: ::c_int,
pub tm_year: ::c_int,
pub tm_wday: ::c_int,
pub tm_yday: ::c_int,
pub tm_isdst: ::c_int
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::c_ulong,
pub ai_canonname: *mut ::c_char,
pub ai_addr: *mut ::sockaddr,
pub ai_next: *mut addrinfo,
pub ai_eflags: ::c_int,
}
pub struct in_addr {
pub s_addr: in_addr_t
}
pub struct ip_mreq_source {
pub imr_multiaddr: in_addr,
pub imr_sourceaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct sockaddr {
pub sa_len: ::c_uchar,
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 14],
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 120],
}
pub struct sockaddr_in {
pub sin_len: ::c_uchar,
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [::c_char; 8]
}
pub struct sockaddr_in6 {
pub sin6_len: ::c_uchar,
pub sin6_family: ::c_uchar,
pub sin6_port: ::uint16_t,
pub sin6_flowinfo: ::uint32_t,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: ::uint32_t
}
pub struct sockaddr_storage {
pub __ss_len: ::c_uchar,
pub ss_family: sa_family_t,
__ss_pad1: [::c_char; 6],
__ss_align: ::int64_t,
__ss_pad2: [::c_char; 1265],
}
pub struct sockaddr_un {
pub sun_len: ::c_uchar,
pub sun_family: sa_family_t,
pub sun_path: [::c_char; 1023]
}
pub struct st_timespec {
pub tv_sec: ::time_t,
pub tv_nsec: ::c_int,
}
pub struct statfs64 {
pub f_version: ::c_int,
pub f_type: ::c_int,
pub f_bsize: blksize64_t,
pub f_blocks: blkcnt64_t,
pub f_bfree: blkcnt64_t,
pub f_bavail: blkcnt64_t,
pub f_files: ::uint64_t,
pub f_ffree: ::uint64_t,
pub f_fsid: fsid64_t,
pub f_vfstype: ::c_int,
pub f_fsize: blksize64_t,
pub f_vfsnumber: ::c_int,
pub f_vfsoff: ::c_int,
pub f_vfslen: ::c_int,
pub f_vfsvers: ::c_int,
pub f_fname: [::c_char; 32],
pub f_fpack: [::c_char; 32],
pub f_name_max: ::c_int,
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_gecos: *mut ::c_char,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char
}
pub struct utsname {
pub sysname: [::c_char; 32],
pub nodename: [::c_char; 32],
pub release: [::c_char; 32],
pub version: [::c_char; 32],
pub machine: [::c_char; 32],
}
pub struct xutsname {
pub nid: ::c_uint,
pub reserved: ::c_int,
pub longnid: ::c_ulonglong,
}
pub struct cmsghdr {
pub cmsg_len: ::socklen_t,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
pub struct sigevent {
pub sigev_value: ::sigval,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
pub sigev_notify_function: extern fn(val: ::sigval),
pub sigev_notify_attributes: *mut pthread_attr_t,
}
// Should be union with another 'sival_int'
pub struct sigval64 {
pub sival_ptr: ::c_ulonglong,
}
pub struct sigevent64 {
pub sigev_value: sigval64,
pub sigev_signo: ::c_int,
pub sigev_notify: ::c_int,
pub sigev_notify_function: ::c_ulonglong,
pub sigev_notify_attributes: ::c_ulonglong,
}
pub struct osigevent {
pub sevt_value: *mut ::c_void,
pub sevt_signo: signal_t,
}
pub struct poll_ctl {
pub cmd: ::c_short,
pub events: ::c_short,
pub fd: ::c_int,
}
pub struct sf_parms {
pub header_data: *mut ::c_void,
pub header_length: ::c_uint,
pub file_descriptor: ::c_int,
pub file_size: ::uint64_t,
pub file_offset: ::uint64_t,
pub file_bytes: ::int64_t,
pub trailer_data: *mut ::c_void,
pub trailer_length: ::c_uint,
pub bytes_sent: ::uint64_t,
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
pub struct sched_param {
pub sched_priority: ::c_int,
pub sched_policy: ::c_int,
pub sched_reserved: [::c_int; 6],
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
pub __pad: [::c_int; 4],
}
pub struct posix_spawnattr_t {
pub posix_attr_flags: ::c_short,
pub posix_attr_pgroup: ::pid_t,
pub posix_attr_sigmask: ::sigset_t,
pub posix_attr_sigdefault: ::sigset_t,
pub posix_attr_schedpolicy: ::c_int,
pub posix_attr_schedparam: sched_param,
}
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_pathv: *mut *mut c_char,
pub gl_offs: ::size_t,
pub gl_padr: *mut ::c_void,
pub gl_ptx: *mut ::c_void,
}
pub struct mallinfo {
pub arena: ::c_ulong,
pub ordblks: ::c_int,
pub smblks: ::c_int,
pub hblks: ::c_int,
pub hblkhd: ::c_int,
pub usmblks: ::c_ulong,
pub fsmblks: ::c_ulong,
pub uordblks: ::c_ulong,
pub fordblks: ::c_ulong,
pub keepcost: ::c_int,
}
pub struct utmp_exit_status {
pub e_termination: ::c_short,
pub e_exit: ::c_short,
}
pub struct utmp {
pub ut_user: [::c_char; 256],
pub ut_id: [::c_char; 14],
pub ut_line: [::c_char; 64],
pub ut_pid: ::pid_t,
pub ut_type: ::c_short,
pub ut_time: time64_t,
pub ut_exit: utmp_exit_status,
pub ut_host: [::c_char; 256],
pub __dbl_word_pad: ::c_int,
pub __reservedA: [::c_int; 2],
pub __reservedV: [::c_int; 6],
}
pub struct regmatch_t {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
pub struct regex_t {
pub re_nsub: ::size_t,
pub re_comp: *mut ::c_void,
pub re_cflags: ::c_int,
pub re_erroff: ::size_t,
pub re_len: ::size_t,
pub re_ucoll: [::wchar_t; 2],
pub re_lsub: [*mut ::c_void; 24],
pub re_esub: [*mut ::c_void; 24],
pub re_map: *mut ::c_uchar,
pub __maxsub: ::c_int,
pub __unused: [*mut ::c_void; 34],
}
pub struct rlimit64 {
pub rlim_cur: rlim64_t,
pub rlim_max: rlim64_t,
}
pub struct shmid_ds {
pub shm_perm: ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: shmatt_t,
pub shm_cnattch: shmatt_t,
pub shm_atime: time_t,
pub shm_dtime: time_t,
pub shm_ctime: time_t,
pub shm_handle: ::uint32_t,
pub shm_extshm: ::c_int,
pub shm_pagesize: ::int64_t,
pub shm_lba: ::uint64_t,
pub shm_reserved: ::int64_t,
pub shm_reserved1: ::int64_t,
}
pub struct stat64 {
pub st_dev: dev_t,
pub st_ino: ino_t,
pub st_mode: mode_t,
pub st_nlink: nlink_t,
pub st_flag: ::c_ushort,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: dev_t,
pub st_ssize: ::c_int,
pub st_atim: st_timespec,
pub st_mtim: st_timespec,
pub st_ctim: st_timespec,
pub st_blksize: blksize_t,
pub st_blocks: blkcnt_t,
pub st_vfstype: ::c_int,
pub st_vfs: ::c_uint,
pub st_type: ::c_uint,
pub st_gen: ::c_uint,
pub st_reserved: [::c_uint; 10],
pub st_size: off64_t,
}
pub struct mntent {
pub mnt_fsname: *mut ::c_char,
pub mnt_dir: *mut ::c_char,
pub mnt_type: *mut ::c_char,
pub mnt_opts: *mut ::c_char,
pub mnt_freq: ::c_int,
pub mnt_passno: ::c_int,
}
pub struct ipc_perm {
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: mode_t,
pub seq: ::c_ushort,
pub __reserved: ::c_ushort,
pub key: key_t,
}
pub struct entry {
pub key: *mut ::c_char,
pub data: *mut ::c_void,
}
pub struct mq_attr {
pub mq_flags: ::c_long,
pub mq_maxmsg: ::c_long,
pub mq_msgsize: ::c_long,
pub mq_curmsgs: ::c_long,
}
pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
pub struct if_nameindex {
pub if_index: ::c_uint,
pub if_name: *mut ::c_char,
}
pub struct itimerspec {
pub it_interval: ::timespec,
pub it_value: ::timespec,
}
}
s_no_extra_traits! {
#[cfg(libc_union)]
pub union __sigaction_sa_union {
pub __su_handler: extern fn(c: ::c_int),
pub __su_sigaction: extern fn(c: ::c_int, info: *mut siginfo_t, ptr: *mut ::c_void),
}
pub struct sigaction {
#[cfg(libc_union)]
pub sa_union: __sigaction_sa_union,
pub sa_mask: sigset_t,
pub sa_flags: ::c_int,
}
#[cfg(libc_union)]
pub union __poll_ctl_ext_u {
pub addr: *mut ::c_void,
pub data32: u32,
pub data: u64,
}
pub struct poll_ctl_ext {
pub version: u8,
pub command: u8,
pub events: ::c_short,
pub fd: ::c_int,
#[cfg(libc_union)]
pub u: __poll_ctl_ext_u,
pub reversed64: [u64; 6],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
#[cfg(libc_union)]
impl PartialEq for __sigaction_sa_union {
fn eq(&self, other: &__sigaction_sa_union) -> bool {
unsafe {
self.__su_handler == other.__su_handler
&& self.__su_sigaction == other.__su_sigaction
}
}
}
#[cfg(libc_union)]
impl Eq for __sigaction_sa_union {}
#[cfg(libc_union)]
impl ::fmt::Debug for __sigaction_sa_union {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__sigaction_sa_union")
.field("__su_handler", unsafe { &self.__su_handler })
.field("__su_sigaction", unsafe { &self.__su_sigaction })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __sigaction_sa_union {
fn hash(&self, state: &mut H) {
unsafe {
self.__su_handler.hash(state);
self.__su_sigaction.hash(state);
}
}
}
impl PartialEq for sigaction {
fn eq(&self, other: &sigaction) -> bool {
#[cfg(libc_union)]
let union_eq = self.sa_union == other.sa_union;
#[cfg(not(libc_union))]
let union_eq = true;
self.sa_mask == other.sa_mask
&& self.sa_flags == other.sa_flags
&& union_eq
}
}
impl Eq for sigaction {}
impl ::fmt::Debug for sigaction {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("sigaction");
#[cfg(libc_union)]
struct_formatter.field("sa_union", &self.sa_union);
struct_formatter.field("sa_mask", &self.sa_mask);
struct_formatter.field("sa_flags", &self.sa_flags);
struct_formatter.finish()
}
}
impl ::hash::Hash for sigaction {
fn hash(&self, state: &mut H) {
#[cfg(libc_union)]
self.sa_union.hash(state);
self.sa_mask.hash(state);
self.sa_flags.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __poll_ctl_ext_u {
fn eq(&self, other: &__poll_ctl_ext_u) -> bool {
unsafe {
self.addr == other.addr
&& self.data32 == other.data32
&& self.data == other.data
}
}
}
#[cfg(libc_union)]
impl Eq for __poll_ctl_ext_u {}
#[cfg(libc_union)]
impl ::fmt::Debug for __poll_ctl_ext_u {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__poll_ctl_ext_u")
.field("addr", unsafe { &self.addr })
.field("data32", unsafe { &self.data32 })
.field("data", unsafe { &self.data })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __poll_ctl_ext_u {
fn hash(&self, state: &mut H) {
unsafe {
self.addr.hash(state);
self.data32.hash(state);
self.data.hash(state);
}
}
}
impl PartialEq for poll_ctl_ext {
fn eq(&self, other: &poll_ctl_ext) -> bool {
#[cfg(libc_union)]
let union_eq = self.u == other.u;
#[cfg(not(libc_union))]
let union_eq = true;
self.version == other.version
&& self.command == other.command
&& self.events == other.events
&& self.fd == other.fd
&& self.reversed64 == other.reversed64
&& union_eq
}
}
impl Eq for poll_ctl_ext {}
impl ::fmt::Debug for poll_ctl_ext {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("poll_ctl_ext");
struct_formatter.field("version", &self.version);
struct_formatter.field("command", &self.command);
struct_formatter.field("events", &self.events);
struct_formatter.field("fd", &self.fd);
#[cfg(libc_union)]
struct_formatter.field("u", &self.u);
struct_formatter.field("reversed64", &self.reversed64);
struct_formatter.finish()
}
}
impl ::hash::Hash for poll_ctl_ext {
fn hash(&self, state: &mut H) {
self.version.hash(state);
self.command.hash(state);
self.events.hash(state);
self.fd.hash(state);
#[cfg(libc_union)]
self.u.hash(state);
self.reversed64.hash(state);
}
}
}
}
// dlfcn.h
pub const RTLD_LAZY: ::c_int = 0x4;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_GLOBAL: ::c_int = 0x10000;
pub const RTLD_LOCAL: ::c_int = 0x80000;
pub const RTLD_DEFAULT: *mut ::c_void = -1isize as *mut ::c_void;
pub const RTLD_MYSELF: *mut ::c_void = -2isize as *mut ::c_void;
pub const RTLD_NEXT: *mut ::c_void = -3isize as *mut ::c_void;
// fcntl.h
pub const O_RDONLY: ::c_int = 0x0;
pub const O_WRONLY: ::c_int = 0x1;
pub const O_RDWR: ::c_int = 0x2;
pub const O_NDELAY: ::c_int = 0x8000;
pub const O_APPEND: ::c_int = 0x8;
pub const O_DSYNC: ::c_int = 0x400000;
pub const O_CREAT: ::c_int = 0x100;
pub const O_EXCL: ::c_int = 0x400;
pub const O_NOCTTY: ::c_int = 0x800;
pub const O_TRUNC: ::c_int = 0x200;
pub const O_NOFOLLOW: ::c_int = 0x1000000;
pub const O_DIRECTORY: ::c_int = 0x80000;
pub const O_SEARCH: ::c_int = 0x20;
pub const O_EXEC: ::c_int = 0x20;
pub const O_CLOEXEC: ::c_int = 0x800000;
pub const O_ACCMODE: ::c_int = O_RDONLY | O_WRONLY | O_RDWR;
pub const O_DIRECT: ::c_int = 0x8000000;
pub const O_TTY_INIT: ::c_int = 0;
pub const O_RSYNC: ::c_int = 0x200000;
pub const O_LARGEFILE: ::c_int = 0x4000000;
pub const F_CLOSEM: ::c_int = 10;
pub const F_DUPFD_CLOEXEC: ::c_int = 16;
pub const F_GETLK64: ::c_int = 11;
pub const F_SETLK64: ::c_int = 12;
pub const F_SETLKW64: ::c_int = 13;
pub const F_DUP2FD: ::c_int = 14;
pub const F_TSTLK: ::c_int = 15;
pub const F_GETLK: ::c_int = F_GETLK64;
pub const F_SETLK: ::c_int = F_SETLK64;
pub const F_SETLKW: ::c_int = F_SETLKW64;
pub const F_GETOWN: ::c_int = 8;
pub const F_SETOWN: ::c_int = 9;
pub const AT_FDCWD: ::c_int = -2;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
pub const AT_SYMLINK_FOLLOW: ::c_int = 2;
pub const AT_REMOVEDIR: ::c_int = 1;
pub const AT_EACCESS: ::c_int = 1;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const O_SYNC: ::c_int = 16;
pub const O_NONBLOCK: ::c_int = 4;
pub const FASYNC: ::c_int = 0x20000;
pub const POSIX_FADV_NORMAL: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_RANDOM: ::c_int = 3;
pub const POSIX_FADV_WILLNEED: ::c_int = 4;
pub const POSIX_FADV_DONTNEED: ::c_int = 5;
pub const POSIX_FADV_NOREUSE: ::c_int = 6;
// glob.h
pub const GLOB_APPEND: ::c_int = 0x1;
pub const GLOB_DOOFFS: ::c_int = 0x2;
pub const GLOB_ERR: ::c_int = 0x4;
pub const GLOB_MARK: ::c_int = 0x8;
pub const GLOB_NOCHECK: ::c_int = 0x10;
pub const GLOB_NOSORT: ::c_int = 0x20;
pub const GLOB_NOESCAPE: ::c_int = 0x80;
pub const GLOB_NOSPACE: ::c_int = 0x2000;
pub const GLOB_ABORTED: ::c_int = 0x1000;
pub const GLOB_NOMATCH: ::c_int = 0x4000;
pub const GLOB_NOSYS: ::c_int = 0x8000;
// langinfo.h
pub const DAY_1: ::nl_item = 13;
pub const DAY_2: ::nl_item = 14;
pub const DAY_3: ::nl_item = 15;
pub const DAY_4: ::nl_item = 16;
pub const DAY_5: ::nl_item = 17;
pub const DAY_6: ::nl_item = 18;
pub const DAY_7: ::nl_item = 19;
pub const ABDAY_1: ::nl_item = 6;
pub const ABDAY_2: ::nl_item = 7;
pub const ABDAY_3: ::nl_item = 8;
pub const ABDAY_4: ::nl_item = 9;
pub const ABDAY_5: ::nl_item = 10;
pub const ABDAY_6: ::nl_item = 11;
pub const ABDAY_7: ::nl_item = 12;
pub const MON_1: ::nl_item = 32;
pub const MON_2: ::nl_item = 33;
pub const MON_3: ::nl_item = 34;
pub const MON_4: ::nl_item = 35;
pub const MON_5: ::nl_item = 36;
pub const MON_6: ::nl_item = 37;
pub const MON_7: ::nl_item = 38;
pub const MON_8: ::nl_item = 39;
pub const MON_9: ::nl_item = 40;
pub const MON_10: ::nl_item = 41;
pub const MON_11: ::nl_item = 42;
pub const MON_12: ::nl_item = 43;
pub const ABMON_1: ::nl_item = 20;
pub const ABMON_2: ::nl_item = 21;
pub const ABMON_3: ::nl_item = 22;
pub const ABMON_4: ::nl_item = 23;
pub const ABMON_5: ::nl_item = 24;
pub const ABMON_6: ::nl_item = 25;
pub const ABMON_7: ::nl_item = 26;
pub const ABMON_8: ::nl_item = 27;
pub const ABMON_9: ::nl_item = 28;
pub const ABMON_10: ::nl_item = 29;
pub const ABMON_11: ::nl_item = 30;
pub const ABMON_12: ::nl_item = 31;
pub const RADIXCHAR: ::nl_item = 44;
pub const THOUSEP: ::nl_item = 45;
pub const YESSTR: ::nl_item = 46;
pub const NOSTR: ::nl_item = 47;
pub const CRNCYSTR: ::nl_item = 48;
pub const D_T_FMT: ::nl_item = 1;
pub const D_FMT: ::nl_item = 2;
pub const T_FMT: ::nl_item = 3;
pub const AM_STR: ::nl_item = 4;
pub const PM_STR: ::nl_item = 5;
pub const CODESET: ::nl_item = 49;
pub const T_FMT_AMPM: ::nl_item = 55;
pub const ERA: ::nl_item = 56;
pub const ERA_D_FMT: ::nl_item = 57;
pub const ERA_D_T_FMT: ::nl_item = 58;
pub const ERA_T_FMT: ::nl_item = 59;
pub const ALT_DIGITS: ::nl_item = 60;
pub const YESEXPR: ::nl_item = 61;
pub const NOEXPR: ::nl_item = 62;
// locale.h
pub const LC_GLOBAL_LOCALE: ::locale_t = -1isize as ::locale_t;
pub const LC_CTYPE: ::c_int = 1;
pub const LC_NUMERIC: ::c_int = 3;
pub const LC_TIME: ::c_int = 4;
pub const LC_COLLATE: ::c_int = 0;
pub const LC_MONETARY: ::c_int = 2;
pub const LC_MESSAGES: ::c_int = 4;
pub const LC_ALL: ::c_int = -1;
pub const LC_CTYPE_MASK: ::c_int = 2;
pub const LC_NUMERIC_MASK: ::c_int = 16;
pub const LC_TIME_MASK: ::c_int = 32;
pub const LC_COLLATE_MASK: ::c_int = 1;
pub const LC_MONETARY_MASK: ::c_int = 8;
pub const LC_MESSAGES_MASK: ::c_int = 4;
pub const LC_ALL_MASK: ::c_int = LC_CTYPE_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK
| LC_COLLATE_MASK
| LC_MONETARY_MASK
| LC_MESSAGES_MASK;
// netdb.h
pub const NI_MAXHOST: ::socklen_t = 1025;
pub const NI_MAXSERV: ::socklen_t = 32;
pub const NI_NOFQDN: ::socklen_t = 0x1;
pub const NI_NUMERICHOST: ::socklen_t = 0x2;
pub const NI_NAMEREQD: ::socklen_t = 0x4;
pub const NI_NUMERICSERV: ::socklen_t = 0x8;
pub const NI_DGRAM: ::socklen_t = 0x10;
pub const NI_NUMERICSCOPE: ::socklen_t = 0x40;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
pub const EAI_FAMILY: ::c_int = 5;
pub const EAI_MEMORY: ::c_int = 6;
pub const EAI_NODATA: ::c_int = 7;
pub const EAI_NONAME: ::c_int = 8;
pub const EAI_SERVICE: ::c_int = 9;
pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
pub const EAI_OVERFLOW: ::c_int = 13;
pub const AI_CANONNAME: ::c_int = 0x01;
pub const AI_PASSIVE: ::c_int = 0x02;
pub const AI_NUMERICHOST: ::c_int = 0x04;
pub const AI_ADDRCONFIG: ::c_int = 0x08;
pub const AI_V4MAPPED: ::c_int = 0x10;
pub const AI_ALL: ::c_int = 0x20;
pub const AI_NUMERICSERV: ::c_int = 0x40;
pub const AI_EXTFLAGS: ::c_int = 0x80;
pub const AI_DEFAULT: ::c_int = AI_V4MAPPED | AI_ADDRCONFIG;
pub const IPV6_ADDRFORM: ::c_int = 22;
pub const IPV6_ADDR_PREFERENCES: ::c_int = 74;
pub const IPV6_CHECKSUM: ::c_int = 39;
pub const IPV6_DONTFRAG: ::c_int = 45;
pub const IPV6_DSTOPTS: ::c_int = 54;
pub const IPV6_FLOWINFO_FLOWLABEL: ::c_int = 16777215;
pub const IPV6_FLOWINFO_PRIORITY: ::c_int = 251658240;
pub const IPV6_HOPLIMIT: ::c_int = 40;
pub const IPV6_HOPOPTS: ::c_int = 52;
pub const IPV6_NEXTHOP: ::c_int = 48;
pub const IPV6_PATHMTU: ::c_int = 46;
pub const IPV6_PKTINFO: ::c_int = 33;
pub const IPV6_PREFER_SRC_CGA: ::c_int = 16;
pub const IPV6_PREFER_SRC_COA: ::c_int = 2;
pub const IPV6_PREFER_SRC_HOME: ::c_int = 1;
pub const IPV6_PREFER_SRC_NONCGA: ::c_int = 32;
pub const IPV6_PREFER_SRC_PUBLIC: ::c_int = 4;
pub const IPV6_PREFER_SRC_TMP: ::c_int = 8;
pub const IPV6_RECVDSTOPTS: ::c_int = 56;
pub const IPV6_RECVHOPLIMIT: ::c_int = 41;
pub const IPV6_RECVHOPOPTS: ::c_int = 53;
pub const IPV6_RECVPATHMTU: ::c_int = 47;
pub const IPV6_RECVRTHDR: ::c_int = 51;
pub const IPV6_RECVTCLASS: ::c_int = 42;
pub const IPV6_RTHDR: ::c_int = 50;
pub const IPV6_RTHDRDSTOPTS: ::c_int = 55;
pub const IPV6_TCLASS: ::c_int = 43;
// net/bpf.h
pub const DLT_NULL: ::c_int = 0x18;
pub const DLT_EN10MB: ::c_int = 0x6;
pub const DLT_EN3MB: ::c_int = 0x1a;
pub const DLT_AX25: ::c_int = 0x5;
pub const DLT_PRONET: ::c_int = 0xd;
pub const DLT_IEEE802: ::c_int = 0x7;
pub const DLT_ARCNET: ::c_int = 0x23;
pub const DLT_SLIP: ::c_int = 0x1c;
pub const DLT_PPP: ::c_int = 0x17;
pub const DLT_FDDI: ::c_int = 0xf;
pub const DLT_ATM: ::c_int = 0x25;
pub const DLT_IPOIB: ::c_int = 0xc7;
pub const BIOCSETF: ::c_ulong = 0x80104267;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const BIOCGBLEN: ::c_int = 0x40044266;
pub const BIOCSBLEN: ::c_int = 0xc0044266;
pub const BIOCFLUSH: ::c_int = 0x20004268;
pub const BIOCPROMISC: ::c_int = 0x20004269;
pub const BIOCGDLT: ::c_int = 0x4004426a;
pub const BIOCSRTIMEOUT: ::c_int = 0x8010426d;
pub const BIOCGSTATS: ::c_int = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_int = 0x80044270;
pub const BIOCVERSION: ::c_int = 0x40044271;
pub const BIOCSDEVNO: ::c_int = 0x20004272;
pub const BIOCGETIF: ::c_ulong = 0x4020426b;
pub const BIOCSETIF: ::c_ulong = 0xffffffff8020426c;
pub const BPF_ABS: ::c_int = 32;
pub const BPF_ADD: ::c_int = 0;
pub const BPF_ALIGNMENT: ::c_ulong = 4;
pub const BPF_ALU: ::c_int = 4;
pub const BPF_AND: ::c_int = 80;
pub const BPF_B: ::c_int = 16;
pub const BPF_DIV: ::c_int = 48;
pub const BPF_H: ::c_int = 8;
pub const BPF_IMM: ::c_int = 0;
pub const BPF_IND: ::c_int = 64;
pub const BPF_JA: ::c_int = 0;
pub const BPF_JEQ: ::c_int = 16;
pub const BPF_JGE: ::c_int = 48;
pub const BPF_JGT: ::c_int = 32;
pub const BPF_JMP: ::c_int = 5;
pub const BPF_JSET: ::c_int = 64;
pub const BPF_K: ::c_int = 0;
pub const BPF_LD: ::c_int = 0;
pub const BPF_LDX: ::c_int = 1;
pub const BPF_LEN: ::c_int = 128;
pub const BPF_LSH: ::c_int = 96;
pub const BPF_MAXINSNS: ::c_int = 512;
pub const BPF_MEM: ::c_int = 96;
pub const BPF_MEMWORDS: ::c_int = 16;
pub const BPF_MISC: ::c_int = 7;
pub const BPF_MSH: ::c_int = 160;
pub const BPF_MUL: ::c_int = 32;
pub const BPF_NEG: ::c_int = 128;
pub const BPF_OR: ::c_int = 64;
pub const BPF_RET: ::c_int = 6;
pub const BPF_RSH: ::c_int = 112;
pub const BPF_ST: ::c_int = 2;
pub const BPF_STX: ::c_int = 3;
pub const BPF_SUB: ::c_int = 16;
pub const BPF_W: ::c_int = 0;
pub const BPF_X: ::c_int = 8;
// net/if.h
pub const IFNET_SLOWHZ: ::c_int = 1;
pub const IFQ_MAXLEN: ::c_int = 50;
pub const IF_NAMESIZE: ::c_int = 16;
pub const IFNAMSIZ: ::c_int = 16;
pub const IFF_UP: ::c_int = 0x1;
pub const IFF_BROADCAST: ::c_int = 0x2;
pub const IFF_DEBUG: ::c_int = 0x4;
pub const IFF_LOOPBACK: ::c_int = 0x8;
pub const IFF_POINTOPOINT: ::c_int = 0x10;
pub const IFF_NOTRAILERS: ::c_int = 0x20;
pub const IFF_RUNNING: ::c_int = 0x40;
pub const IFF_NOARP: ::c_int = 0x80;
pub const IFF_PROMISC: ::c_int = 0x100;
pub const IFF_ALLMULTI: ::c_int = 0x200;
pub const IFF_MULTICAST: ::c_int = 0x80000;
pub const IFF_LINK0: ::c_int = 0x100000;
pub const IFF_LINK1: ::c_int = 0x200000;
pub const IFF_LINK2: ::c_int = 0x400000;
pub const IFF_OACTIVE: ::c_int = 0x400;
pub const IFF_SIMPLEX: ::c_int = 0x800;
// net/if_arp.h
pub const ARPHRD_ETHER: ::c_int = 1;
pub const ARPHRD_802_5: ::c_int = 6;
pub const ARPHRD_802_3: ::c_int = 6;
pub const ARPHRD_FDDI: ::c_int = 1;
pub const ARPOP_REQUEST: ::c_int = 1;
pub const ARPOP_REPLY: ::c_int = 2;
// net/route.h
pub const RTM_ADD: ::c_int = 0x1;
pub const RTM_DELETE: ::c_int = 0x2;
pub const RTM_CHANGE: ::c_int = 0x3;
pub const RTM_GET: ::c_int = 0x4;
pub const RTM_LOSING: ::c_int = 0x5;
pub const RTM_REDIRECT: ::c_int = 0x6;
pub const RTM_MISS: ::c_int = 0x7;
pub const RTM_LOCK: ::c_int = 0x8;
pub const RTM_OLDADD: ::c_int = 0x9;
pub const RTM_OLDDEL: ::c_int = 0xa;
pub const RTM_RESOLVE: ::c_int = 0xb;
pub const RTM_NEWADDR: ::c_int = 0xc;
pub const RTM_DELADDR: ::c_int = 0xd;
pub const RTM_IFINFO: ::c_int = 0xe;
pub const RTM_EXPIRE: ::c_int = 0xf;
pub const RTM_RTLOST: ::c_int = 0x10;
pub const RTM_GETNEXT: ::c_int = 0x11;
pub const RTM_SAMEADDR: ::c_int = 0x12;
pub const RTM_SET: ::c_int = 0x13;
pub const RTV_MTU: ::c_int = 0x1;
pub const RTV_HOPCOUNT: ::c_int = 0x2;
pub const RTV_EXPIRE: ::c_int = 0x4;
pub const RTV_RPIPE: ::c_int = 0x8;
pub const RTV_SPIPE: ::c_int = 0x10;
pub const RTV_SSTHRESH: ::c_int = 0x20;
pub const RTV_RTT: ::c_int = 0x40;
pub const RTV_RTTVAR: ::c_int = 0x80;
pub const RTA_DST: ::c_int = 0x1;
pub const RTA_GATEWAY: ::c_int = 0x2;
pub const RTA_NETMASK: ::c_int = 0x4;
pub const RTA_GENMASK: ::c_int = 0x8;
pub const RTA_IFP: ::c_int = 0x10;
pub const RTA_IFA: ::c_int = 0x20;
pub const RTA_AUTHOR: ::c_int = 0x40;
pub const RTA_BRD: ::c_int = 0x80;
pub const RTA_DOWNSTREAM: ::c_int = 0x100;
pub const RTAX_DST: ::c_int = 0;
pub const RTAX_GATEWAY: ::c_int = 1;
pub const RTAX_NETMASK: ::c_int = 2;
pub const RTAX_GENMASK: ::c_int = 3;
pub const RTAX_IFP: ::c_int = 4;
pub const RTAX_IFA: ::c_int = 5;
pub const RTAX_AUTHOR: ::c_int = 6;
pub const RTAX_BRD: ::c_int = 7;
pub const RTAX_MAX: ::c_int = 8;
pub const RTF_UP: ::c_int = 0x1;
pub const RTF_GATEWAY: ::c_int = 0x2;
pub const RTF_HOST: ::c_int = 0x4;
pub const RTF_REJECT: ::c_int = 0x8;
pub const RTF_DYNAMIC: ::c_int = 0x10;
pub const RTF_MODIFIED: ::c_int = 0x20;
pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_MASK: ::c_int = 0x80;
pub const RTF_CLONING: ::c_int = 0x100;
pub const RTF_XRESOLVE: ::c_int = 0x200;
pub const RTF_LLINFO: ::c_int = 0x400;
pub const RTF_STATIC: ::c_int = 0x800;
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_BUL: ::c_int = 0x2000;
pub const RTF_PROTO2: ::c_int = 0x4000;
pub const RTF_PROTO1: ::c_int = 0x8000;
pub const RTF_CLONE: ::c_int = 0x10000;
pub const RTF_CLONED: ::c_int = 0x20000;
pub const RTF_PROTO3: ::c_int = 0x40000;
pub const RTF_BCE: ::c_int = 0x80000;
pub const RTF_PINNED: ::c_int = 0x100000;
pub const RTF_LOCAL: ::c_int = 0x200000;
pub const RTF_BROADCAST: ::c_int = 0x400000;
pub const RTF_MULTICAST: ::c_int = 0x800000;
pub const RTF_ACTIVE_DGD: ::c_int = 0x1000000;
pub const RTF_STOPSRCH: ::c_int = 0x2000000;
pub const RTF_FREE_IN_PROG: ::c_int = 0x4000000;
pub const RTF_PERMANENT6: ::c_int = 0x8000000;
pub const RTF_UNREACHABLE: ::c_int = 0x10000000;
pub const RTF_CACHED: ::c_int = 0x20000000;
pub const RTF_SMALLMTU: ::c_int = 0x40000;
// netinet/in.h
pub const IPPROTO_HOPOPTS: ::c_int = 0;
pub const IPPROTO_IGMP: ::c_int = 2;
pub const IPPROTO_GGP: ::c_int = 3;
pub const IPPROTO_IPIP: ::c_int = 4;
pub const IPPROTO_EGP: ::c_int = 8;
pub const IPPROTO_PUP: ::c_int = 12;
pub const IPPROTO_IDP: ::c_int = 22;
pub const IPPROTO_TP: ::c_int = 29;
pub const IPPROTO_ROUTING: ::c_int = 43;
pub const IPPROTO_FRAGMENT: ::c_int = 44;
pub const IPPROTO_QOS: ::c_int = 45;
pub const IPPROTO_RSVP: ::c_int = 46;
pub const IPPROTO_GRE: ::c_int = 47;
pub const IPPROTO_ESP: ::c_int = 50;
pub const IPPROTO_AH: ::c_int = 51;
pub const IPPROTO_NONE: ::c_int = 59;
pub const IPPROTO_DSTOPTS: ::c_int = 60;
pub const IPPROTO_LOCAL: ::c_int = 63;
pub const IPPROTO_EON: ::c_int = 80;
pub const IPPROTO_BIP: ::c_int = 0x53;
pub const IPPROTO_SCTP: ::c_int = 132;
pub const IPPROTO_MH: ::c_int = 135;
pub const IPPROTO_GIF: ::c_int = 140;
pub const IPPROTO_RAW: ::c_int = 255;
pub const IPPROTO_MAX: ::c_int = 256;
pub const IP_OPTIONS: ::c_int = 1;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_TOS: ::c_int = 3;
pub const IP_TTL: ::c_int = 4;
pub const IP_UNICAST_HOPS: ::c_int = 4;
pub const IP_RECVOPTS: ::c_int = 5;
pub const IP_RECVRETOPTS: ::c_int = 6;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_RETOPTS: ::c_int = 8;
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_MULTICAST_HOPS: ::c_int = 10;
pub const IP_MULTICAST_LOOP: ::c_int = 11;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IP_RECVMACHDR: ::c_int = 14;
pub const IP_RECVIFINFO: ::c_int = 15;
pub const IP_BROADCAST_IF: ::c_int = 16;
pub const IP_DHCPMODE: ::c_int = 17;
pub const IP_RECVIF: ::c_int = 20;
pub const IP_ADDRFORM: ::c_int = 22;
pub const IP_DONTFRAG: ::c_int = 25;
pub const IP_FINDPMTU: ::c_int = 26;
pub const IP_PMTUAGE: ::c_int = 27;
pub const IP_RECVINTERFACE: ::c_int = 32;
pub const IP_RECVTTL: ::c_int = 34;
pub const IP_BLOCK_SOURCE: ::c_int = 58;
pub const IP_UNBLOCK_SOURCE: ::c_int = 59;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 60;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 61;
pub const IP_DEFAULT_MULTICAST_TTL: ::c_int = 1;
pub const IP_DEFAULT_MULTICAST_LOOP: ::c_int = 1;
pub const IP_INC_MEMBERSHIPS: ::c_int = 20;
pub const IP_INIT_MEMBERSHIP: ::c_int = 20;
pub const IPV6_UNICAST_HOPS: ::c_int = IP_TTL;
pub const IPV6_MULTICAST_IF: ::c_int = IP_MULTICAST_IF;
pub const IPV6_MULTICAST_HOPS: ::c_int = IP_MULTICAST_TTL;
pub const IPV6_MULTICAST_LOOP: ::c_int = IP_MULTICAST_LOOP;
pub const IPV6_RECVPKTINFO: ::c_int = 35;
pub const IPV6_V6ONLY: ::c_int = 37;
pub const IPV6_ADD_MEMBERSHIP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_DROP_MEMBERSHIP: ::c_int = IP_DROP_MEMBERSHIP;
pub const IPV6_JOIN_GROUP: ::c_int = IP_ADD_MEMBERSHIP;
pub const IPV6_LEAVE_GROUP: ::c_int = IP_DROP_MEMBERSHIP;
pub const MCAST_BLOCK_SOURCE: ::c_int = 64;
pub const MCAST_EXCLUDE: ::c_int = 2;
pub const MCAST_INCLUDE: ::c_int = 1;
pub const MCAST_JOIN_GROUP: ::c_int = 62;
pub const MCAST_JOIN_SOURCE_GROUP: ::c_int = 66;
pub const MCAST_LEAVE_GROUP: ::c_int = 63;
pub const MCAST_LEAVE_SOURCE_GROUP: ::c_int = 67;
pub const MCAST_UNBLOCK_SOURCE: ::c_int = 65;
// netinet/ip.h
pub const MAXTTL: ::c_int = 255;
pub const IPDEFTTL: ::c_int = 64;
pub const IPOPT_CONTROL: ::c_int = 0;
pub const IPOPT_EOL: ::c_int = 0;
pub const IPOPT_LSRR: ::c_int = 131;
pub const IPOPT_MINOFF: ::c_int = 4;
pub const IPOPT_NOP: ::c_int = 1;
pub const IPOPT_OFFSET: ::c_int = 2;
pub const IPOPT_OLEN: ::c_int = 1;
pub const IPOPT_OPTVAL: ::c_int = 0;
pub const IPOPT_RESERVED1: ::c_int = 0x20;
pub const IPOPT_RESERVED2: ::c_int = 0x60;
pub const IPOPT_RR: ::c_int = 7;
pub const IPOPT_SSRR: ::c_int = 137;
pub const IPOPT_TS: ::c_int = 68;
pub const IPOPT_TS_PRESPEC: ::c_int = 3;
pub const IPOPT_TS_TSANDADDR: ::c_int = 1;
pub const IPOPT_TS_TSONLY: ::c_int = 0;
pub const IPTOS_LOWDELAY: ::c_int = 16;
pub const IPTOS_PREC_CRITIC_ECP: ::c_int = 160;
pub const IPTOS_PREC_FLASH: ::c_int = 96;
pub const IPTOS_PREC_FLASHOVERRIDE: ::c_int = 128;
pub const IPTOS_PREC_IMMEDIATE: ::c_int = 64;
pub const IPTOS_PREC_INTERNETCONTROL: ::c_int = 192;
pub const IPTOS_PREC_NETCONTROL: ::c_int = 224;
pub const IPTOS_PREC_PRIORITY: ::c_int = 32;
pub const IPTOS_PREC_ROUTINE: ::c_int = 16;
pub const IPTOS_RELIABILITY: ::c_int = 4;
pub const IPTOS_THROUGHPUT: ::c_int = 8;
pub const IPVERSION: ::c_int = 4;
// netinet/tcp.h
pub const TCP_NODELAY: ::c_int = 0x1;
pub const TCP_MAXSEG: ::c_int = 0x2;
pub const TCP_RFC1323: ::c_int = 0x4;
pub const TCP_KEEPALIVE: ::c_int = 0x8;
pub const TCP_KEEPIDLE: ::c_int = 0x11;
pub const TCP_KEEPINTVL: ::c_int = 0x12;
pub const TCP_KEEPCNT: ::c_int = 0x13;
pub const TCP_NODELAYACK: ::c_int = 0x14;
// pthread.h
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 0;
pub const PTHREAD_PROCESS_PRIVATE: ::c_ushort = 1;
pub const PTHREAD_STACK_MIN: ::size_t = PAGESIZE as ::size_t * 4;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 5;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 3;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 4;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
pub const PTHREAD_PRIO_INHERIT: ::c_int = 3;
pub const PTHREAD_PRIO_NONE: ::c_int = 1;
pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
// regex.h
pub const REG_EXTENDED: ::c_int = 1;
pub const REG_ICASE: ::c_int = 2;
pub const REG_NEWLINE: ::c_int = 4;
pub const REG_NOSUB: ::c_int = 8;
pub const REG_NOTBOL: ::c_int = 0x100;
pub const REG_NOTEOL: ::c_int = 0x200;
pub const REG_NOMATCH: ::c_int = 1;
pub const REG_BADPAT: ::c_int = 2;
pub const REG_ECOLLATE: ::c_int = 3;
pub const REG_ECTYPE: ::c_int = 4;
pub const REG_EESCAPE: ::c_int = 5;
pub const REG_ESUBREG: ::c_int = 6;
pub const REG_EBRACK: ::c_int = 7;
pub const REG_EPAREN: ::c_int = 8;
pub const REG_EBRACE: ::c_int = 9;
pub const REG_BADBR: ::c_int = 10;
pub const REG_ERANGE: ::c_int = 11;
pub const REG_ESPACE: ::c_int = 12;
pub const REG_BADRPT: ::c_int = 13;
pub const REG_ECHAR: ::c_int = 14;
pub const REG_EBOL: ::c_int = 15;
pub const REG_EEOL: ::c_int = 16;
pub const REG_ENOSYS: ::c_int = 17;
// rpcsvc/mount.h
pub const NFSMNT_ACDIRMAX: ::c_int = 2048;
pub const NFSMNT_ACDIRMIN: ::c_int = 1024;
pub const NFSMNT_ACREGMAX: ::c_int = 512;
pub const NFSMNT_ACREGMIN: ::c_int = 256;
pub const NFSMNT_INT: ::c_int = 64;
pub const NFSMNT_NOAC: ::c_int = 128;
pub const NFSMNT_RETRANS: ::c_int = 16;
pub const NFSMNT_RSIZE: ::c_int = 4;
pub const NFSMNT_SOFT: ::c_int = 1;
pub const NFSMNT_TIMEO: ::c_int = 8;
pub const NFSMNT_WSIZE: ::c_int = 2;
// rpcsvc/rstat.h
pub const CPUSTATES: ::c_int = 4;
// search.h
pub const FIND: ::c_int = 0;
pub const ENTER: ::c_int = 1;
// semaphore.h
pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
// spawn.h
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x1;
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x2;
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x4;
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x8;
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x10;
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x20;
pub const POSIX_SPAWN_FORK_HANDLERS: ::c_int = 0x1000;
// stdio.h
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const _IOFBF: ::c_int = 0o000;
pub const _IONBF: ::c_int = 0o004;
pub const _IOLBF: ::c_int = 0o100;
pub const BUFSIZ: ::c_uint = 4096;
pub const FOPEN_MAX: ::c_uint = 32767;
pub const FILENAME_MAX: ::c_uint = 255;
pub const L_tmpnam: ::c_uint = 21;
pub const TMP_MAX: ::c_uint = 16384;
// stdlib.h
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const RAND_MAX: ::c_int = 32767;
// sys/access.h
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
// sys/aio.h
pub const LIO_NOP: ::c_int = 0;
pub const LIO_READ: ::c_int = 1;
pub const LIO_WRITE: ::c_int = 2;
pub const LIO_NOWAIT: ::c_int = 0;
pub const LIO_WAIT: ::c_int = 1;
pub const AIO_ALLDONE: ::c_int = 2;
pub const AIO_CANCELED: ::c_int = 0;
pub const AIO_NOTCANCELED: ::c_int = 1;
// sys/errno.h
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EAGAIN: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const ENOMSG: ::c_int = 35;
pub const EIDRM: ::c_int = 36;
pub const ECHRNG: ::c_int = 37;
pub const EL2NSYNC: ::c_int = 38;
pub const EL3HLT: ::c_int = 39;
pub const EL3RST: ::c_int = 40;
pub const ELNRNG: ::c_int = 41;
pub const EUNATCH: ::c_int = 42;
pub const ENOCSI: ::c_int = 43;
pub const EL2HLT: ::c_int = 44;
pub const EDEADLK: ::c_int = 45;
pub const ENOLCK: ::c_int = 49;
pub const ECANCELED: ::c_int = 117;
pub const ENOTSUP: ::c_int = 124;
pub const EPROCLIM: ::c_int = 83;
pub const EDQUOT: ::c_int = 88;
pub const EOWNERDEAD: ::c_int = 95;
pub const ENOTRECOVERABLE: ::c_int = 94;
pub const ENOSTR: ::c_int = 123;
pub const ENODATA: ::c_int = 122;
pub const ETIME: ::c_int = 119;
pub const ENOSR: ::c_int = 118;
pub const EREMOTE: ::c_int = 93;
pub const ENOATTR: ::c_int = 112;
pub const ESAD: ::c_int = 113;
pub const ENOTRUST: ::c_int = 114;
pub const ENOLINK: ::c_int = 126;
pub const EPROTO: ::c_int = 121;
pub const EMULTIHOP: ::c_int = 125;
pub const EBADMSG: ::c_int = 120;
pub const ENAMETOOLONG: ::c_int = 86;
pub const EOVERFLOW: ::c_int = 127;
pub const EILSEQ: ::c_int = 116;
pub const ENOSYS: ::c_int = 109;
pub const ELOOP: ::c_int = 85;
pub const ERESTART: ::c_int = 82;
pub const ENOTEMPTY: ::c_int = 87;
pub const EUSERS: ::c_int = 84;
pub const ENOTSOCK: ::c_int = 57;
pub const EDESTADDRREQ: ::c_int = 58;
pub const EMSGSIZE: ::c_int = 59;
pub const EPROTOTYPE: ::c_int = 60;
pub const ENOPROTOOPT: ::c_int = 61;
pub const EPROTONOSUPPORT: ::c_int = 62;
pub const ESOCKTNOSUPPORT: ::c_int = 63;
pub const EOPNOTSUPP: ::c_int = 64;
pub const EPFNOSUPPORT: ::c_int = 65;
pub const EAFNOSUPPORT: ::c_int = 66;
pub const EADDRINUSE: ::c_int = 67;
pub const EADDRNOTAVAIL: ::c_int = 68;
pub const ENETDOWN: ::c_int = 69;
pub const ENETUNREACH: ::c_int = 70;
pub const ENETRESET: ::c_int = 71;
pub const ECONNABORTED: ::c_int = 72;
pub const ECONNRESET: ::c_int = 73;
pub const ENOBUFS: ::c_int = 74;
pub const EISCONN: ::c_int = 75;
pub const ENOTCONN: ::c_int = 76;
pub const ESHUTDOWN: ::c_int = 77;
pub const ETOOMANYREFS: ::c_int = 115;
pub const ETIMEDOUT: ::c_int = 78;
pub const ECONNREFUSED: ::c_int = 79;
pub const EHOSTDOWN: ::c_int = 80;
pub const EHOSTUNREACH: ::c_int = 81;
pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const EALREADY: ::c_int = 56;
pub const EINPROGRESS: ::c_int = 55;
pub const ESTALE: ::c_int = 52;
// sys/dr.h
pub const LPAR_INFO_FORMAT1: ::c_int = 1;
pub const LPAR_INFO_FORMAT2: ::c_int = 2;
pub const WPAR_INFO_FORMAT: ::c_int = 3;
pub const PROC_MODULE_INFO: ::c_int = 4;
pub const NUM_PROC_MODULE_TYPES: ::c_int = 5;
pub const LPAR_INFO_VRME_NUM_POOLS: ::c_int = 6;
pub const LPAR_INFO_VRME_POOLS: ::c_int = 7;
pub const LPAR_INFO_VRME_LPAR: ::c_int = 8;
pub const LPAR_INFO_VRME_RESET_HWMARKS: ::c_int = 9;
pub const LPAR_INFO_VRME_ALLOW_DESIRED: ::c_int = 10;
pub const EMTP_INFO_FORMAT: ::c_int = 11;
pub const LPAR_INFO_LPM_CAPABILITY: ::c_int = 12;
pub const ENERGYSCALE_INFO: ::c_int = 13;
// sys/file.h
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
// sys/flock.h
pub const F_RDLCK: ::c_short = 0o01;
pub const F_WRLCK: ::c_short = 0o02;
pub const F_UNLCK: ::c_short = 0o03;
// sys/fs/quota_common.h
pub const Q_QUOTAON: ::c_int = 0x100;
pub const Q_QUOTAOFF: ::c_int = 0x200;
pub const Q_SETUSE: ::c_int = 0x500;
pub const Q_SYNC: ::c_int = 0x600;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQLIM: ::c_int = 0x400;
pub const Q_SETQUOTA: ::c_int = 0x400;
// sys/ioctl.h
pub const IOCPARM_MASK: ::c_int = 0x7f;
pub const IOC_VOID: ::c_int = 0x20000000;
pub const IOC_OUT: ::c_int = 0x40000000;
pub const IOC_IN: ::c_int = 0x40000000 << 1;
pub const IOC_INOUT: ::c_int = IOC_IN | IOC_OUT;
pub const FIOCLEX: ::c_int = 536897025;
pub const FIONCLEX: ::c_int = 536897026;
pub const FIONREAD: ::c_int = 1074030207;
pub const FIONBIO: ::c_int = -2147195266;
pub const FIOASYNC: ::c_int = -2147195267;
pub const FIOSETOWN: ::c_int = -2147195268;
pub const FIOGETOWN: ::c_int = 1074030203;
pub const TIOCGETD: ::c_int = 0x40047400;
pub const TIOCSETD: ::c_int = 0x80047401;
pub const TIOCHPCL: ::c_int = 0x20007402;
pub const TIOCMODG: ::c_int = 0x40047403;
pub const TIOCMODS: ::c_int = 0x80047404;
pub const TIOCM_LE: ::c_int = 0x1;
pub const TIOCM_DTR: ::c_int = 0x2;
pub const TIOCM_RTS: ::c_int = 0x4;
pub const TIOCM_ST: ::c_int = 0x8;
pub const TIOCM_SR: ::c_int = 0x10;
pub const TIOCM_CTS: ::c_int = 0x20;
pub const TIOCM_CAR: ::c_int = 0x40;
pub const TIOCM_CD: ::c_int = 0x40;
pub const TIOCM_RNG: ::c_int = 0x80;
pub const TIOCM_RI: ::c_int = 0x80;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCGETP: ::c_int = 0x40067408;
pub const TIOCSETP: ::c_int = 0x80067409;
pub const TIOCSETN: ::c_int = 0x8006740a;
pub const TIOCEXCL: ::c_int = 0x2000740d;
pub const TIOCNXCL: ::c_int = 0x2000740e;
pub const TIOCFLUSH: ::c_int = 0x80047410;
pub const TIOCSETC: ::c_int = 0x80067411;
pub const TIOCGETC: ::c_int = 0x40067412;
pub const TANDEM: ::c_int = 0x1;
pub const CBREAK: ::c_int = 0x2;
pub const LCASE: ::c_int = 0x4;
pub const MDMBUF: ::c_int = 0x800000;
pub const XTABS: ::c_int = 0xc00;
pub const SIOCADDMULTI: ::c_int = -2145359567;
pub const SIOCADDRT: ::c_int = -2143784438;
pub const SIOCDARP: ::c_int = -2142476000;
pub const SIOCDELMULTI: ::c_int = -2145359566;
pub const SIOCDELRT: ::c_int = -2143784437;
pub const SIOCDIFADDR: ::c_int = -2144835303;
pub const SIOCGARP: ::c_int = -1068734170;
pub const SIOCGIFADDR: ::c_int = -1071093471;
pub const SIOCGIFBRDADDR: ::c_int = -1071093469;
pub const SIOCGIFCONF: ::c_int = -1072666299;
pub const SIOCGIFDSTADDR: ::c_int = -1071093470;
pub const SIOCGIFFLAGS: ::c_int = -1071093487;
pub const SIOCGIFHWADDR: ::c_int = -1068209771;
pub const SIOCGIFMETRIC: ::c_int = -1071093481;
pub const SIOCGIFMTU: ::c_int = -1071093418;
pub const SIOCGIFNETMASK: ::c_int = -1071093467;
pub const SIOCSARP: ::c_int = -2142476002;
pub const SIOCSIFADDR: ::c_int = -2144835316;
pub const SIOCSIFBRDADDR: ::c_int = -2144835309;
pub const SIOCSIFDSTADDR: ::c_int = -2144835314;
pub const SIOCSIFFLAGS: ::c_int = -2144835312;
pub const SIOCSIFMETRIC: ::c_int = -2144835304;
pub const SIOCSIFMTU: ::c_int = -2144835240;
pub const SIOCSIFNETMASK: ::c_int = -2144835306;
pub const TIOCUCNTL: ::c_int = -2147191706;
pub const TIOCCONS: ::c_int = -2147191710;
pub const TIOCPKT: ::c_int = -2147191696;
pub const TIOCPKT_DATA: ::c_int = 0;
pub const TIOCPKT_FLUSHREAD: ::c_int = 1;
pub const TIOCPKT_FLUSHWRITE: ::c_int = 2;
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
pub const TIOCPKT_START: ::c_int = 8;
pub const TIOCPKT_STOP: ::c_int = 4;
// sys/ipc.h
pub const IPC_ALLOC: ::c_int = 0o100000;
pub const IPC_CREAT: ::c_int = 0o020000;
pub const IPC_EXCL: ::c_int = 0o002000;
pub const IPC_NOWAIT: ::c_int = 0o004000;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 101;
pub const IPC_R: ::c_int = 0o0400;
pub const IPC_W: ::c_int = 0o0200;
pub const IPC_O: ::c_int = 0o1000;
pub const IPC_NOERROR: ::c_int = 0o10000;
pub const IPC_STAT: ::c_int = 102;
pub const IPC_PRIVATE: ::key_t = -1;
pub const SHM_LOCK: ::c_int = 201;
pub const SHM_UNLOCK: ::c_int = 202;
// sys/ldr.h
pub const L_GETINFO: ::c_int = 2;
pub const L_GETMESSAGE: ::c_int = 1;
pub const L_GETLIBPATH: ::c_int = 3;
pub const L_GETXINFO: ::c_int = 8;
// sys/limits.h
pub const PATH_MAX: ::c_int = 1023;
pub const PAGESIZE: ::c_int = 4096;
pub const IOV_MAX: ::c_int = 16;
pub const AIO_LISTIO_MAX: ::c_int = 4096;
pub const PIPE_BUF: usize = 32768;
pub const OPEN_MAX: ::c_int = 65534;
pub const MAX_INPUT: ::c_int = 512;
pub const MAX_CANON: ::c_int = 256;
pub const ARG_MAX: ::c_int = 1048576;
pub const BC_BASE_MAX: ::c_int = 99;
pub const BC_DIM_MAX: ::c_int = 0x800;
pub const BC_SCALE_MAX: ::c_int = 99;
pub const BC_STRING_MAX: ::c_int = 0x800;
pub const CHARCLASS_NAME_MAX: ::c_int = 14;
pub const CHILD_MAX: ::c_int = 128;
pub const COLL_WEIGHTS_MAX: ::c_int = 4;
pub const EXPR_NEST_MAX: ::c_int = 32;
pub const NZERO: ::c_int = 20;
// sys/lockf.h
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
// sys/machine.h
pub const BIG_ENDIAN: ::c_int = 4321;
pub const LITTLE_ENDIAN: ::c_int = 1234;
pub const PDP_ENDIAN: ::c_int = 3412;
// sys/mman.h
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const MAP_FILE: ::c_int = 0;
pub const MAP_SHARED: ::c_int = 1;
pub const MAP_PRIVATE: ::c_int = 2;
pub const MAP_FIXED: ::c_int = 0x100;
pub const MAP_ANON: ::c_int = 0x10;
pub const MAP_ANONYMOUS: ::c_int = 0x10;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MAP_TYPE: ::c_int = 0xf0;
pub const MCL_CURRENT: ::c_int = 0x100;
pub const MCL_FUTURE: ::c_int = 0x200;
pub const MS_SYNC: ::c_int = 0x20;
pub const MS_ASYNC: ::c_int = 0x10;
pub const MS_INVALIDATE: ::c_int = 0x40;
pub const POSIX_MADV_NORMAL: ::c_int = 1;
pub const POSIX_MADV_RANDOM: ::c_int = 3;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 4;
pub const POSIX_MADV_DONTNEED: ::c_int = 5;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
// sys/mode.h
pub const S_IFMT: mode_t = 0o170000;
pub const S_IFREG: mode_t = 0o100000;
pub const S_IFDIR: mode_t = 0o40000;
pub const S_IFBLK: mode_t = 0o60000;
pub const S_IFCHR: mode_t = 0o20000;
pub const S_IFIFO: mode_t = 0o10000;
pub const S_IRWXU: mode_t = 0o700;
pub const S_IRUSR: mode_t = 0o400;
pub const S_IWUSR: mode_t = 0o200;
pub const S_IXUSR: mode_t = 0o100;
pub const S_IRWXG: mode_t = 0o70;
pub const S_IRGRP: mode_t = 0o40;
pub const S_IWGRP: mode_t = 0o20;
pub const S_IXGRP: mode_t = 0o10;
pub const S_IRWXO: mode_t = 7;
pub const S_IROTH: mode_t = 4;
pub const S_IWOTH: mode_t = 2;
pub const S_IXOTH: mode_t = 1;
pub const S_IFLNK: mode_t = 0o120000;
pub const S_IFSOCK: mode_t = 0o140000;
pub const S_IEXEC: mode_t = 0o100;
pub const S_IWRITE: mode_t = 0o200;
pub const S_IREAD: mode_t = 0o400;
// sys/msg.h
pub const MSG_NOERROR: ::c_int = 0o10000;
// sys/m_signal.h
pub const SIGSTKSZ: ::size_t = 4096;
pub const MINSIGSTKSZ: ::size_t = 1200;
// sys/params.h
pub const MAXPATHLEN: ::c_int = PATH_MAX + 1;
pub const MAXSYMLINKS: ::c_int = 20;
pub const MAXHOSTNAMELEN: ::c_int = 256;
pub const MAXUPRC: ::c_int = 128;
pub const NGROUPS_MAX: ::c_ulong = 2048;
pub const NGROUPS: ::c_ulong = NGROUPS_MAX;
pub const NOFILE: ::c_int = OPEN_MAX;
// sys/poll.h
pub const POLLIN: ::c_short = 0x0001;
pub const POLLPRI: ::c_short = 0x0004;
pub const POLLOUT: ::c_short = 0x0002;
pub const POLLERR: ::c_short = 0x4000;
pub const POLLHUP: ::c_short = 0x2000;
pub const POLLMSG: ::c_short = 0x0080;
pub const POLLSYNC: ::c_short = 0x8000;
pub const POLLNVAL: ::c_short = POLLSYNC;
pub const POLLNORM: ::c_short = POLLIN;
pub const POLLRDNORM: ::c_short = 0x0010;
pub const POLLWRNORM: ::c_short = POLLOUT;
pub const POLLRDBAND: ::c_short = 0x0020;
pub const POLLWRBAND: ::c_short = 0x0040;
// sys/pollset.h
pub const PS_ADD: ::c_uchar = 0;
pub const PS_MOD: ::c_uchar = 1;
pub const PS_DELETE: ::c_uchar = 2;
pub const PS_REPLACE: ::c_uchar = 3;
// sys/ptrace.h
pub const PT_TRACE_ME: ::c_int = 0;
pub const PT_READ_I: ::c_int = 1;
pub const PT_READ_D: ::c_int = 2;
pub const PT_WRITE_I: ::c_int = 4;
pub const PT_WRITE_D: ::c_int = 5;
pub const PT_CONTINUE: ::c_int = 7;
pub const PT_KILL: ::c_int = 8;
pub const PT_STEP: ::c_int = 9;
pub const PT_READ_GPR: ::c_int = 11;
pub const PT_READ_FPR: ::c_int = 12;
pub const PT_WRITE_GPR: ::c_int = 14;
pub const PT_WRITE_FPR: ::c_int = 15;
pub const PT_READ_BLOCK: ::c_int = 17;
pub const PT_WRITE_BLOCK: ::c_int = 19;
pub const PT_ATTACH: ::c_int = 30;
pub const PT_DETACH: ::c_int = 31;
pub const PT_REGSET: ::c_int = 32;
pub const PT_REATT: ::c_int = 33;
pub const PT_LDINFO: ::c_int = 34;
pub const PT_MULTI: ::c_int = 35;
pub const PT_NEXT: ::c_int = 36;
pub const PT_SET: ::c_int = 37;
pub const PT_CLEAR: ::c_int = 38;
pub const PT_LDXINFO: ::c_int = 39;
pub const PT_QUERY: ::c_int = 40;
pub const PT_WATCH: ::c_int = 41;
pub const PTT_CONTINUE: ::c_int = 50;
pub const PTT_STEP: ::c_int = 51;
pub const PTT_READ_SPRS: ::c_int = 52;
pub const PTT_WRITE_SPRS: ::c_int = 53;
pub const PTT_READ_GPRS: ::c_int = 54;
pub const PTT_WRITE_GPRS: ::c_int = 55;
pub const PTT_READ_FPRS: ::c_int = 56;
pub const PTT_WRITE_FPRS: ::c_int = 57;
pub const PTT_READ_VEC: ::c_int = 58;
pub const PTT_WRITE_VEC: ::c_int = 59;
pub const PTT_WATCH: ::c_int = 60;
pub const PTT_SET_TRAP: ::c_int = 61;
pub const PTT_CLEAR_TRAP: ::c_int = 62;
pub const PTT_READ_UKEYSET: ::c_int = 63;
pub const PT_GET_UKEY: ::c_int = 64;
pub const PTT_READ_FPSCR_HI: ::c_int = 65;
pub const PTT_WRITE_FPSCR_HI: ::c_int = 66;
pub const PTT_READ_VSX: ::c_int = 67;
pub const PTT_WRITE_VSX: ::c_int = 68;
pub const PTT_READ_TM: ::c_int = 69;
pub const PTRACE_ATTACH: ::c_int = 14;
pub const PTRACE_CONT: ::c_int = 7;
pub const PTRACE_DETACH: ::c_int = 15;
pub const PTRACE_GETFPREGS: ::c_int = 12;
pub const PTRACE_GETREGS: ::c_int = 10;
pub const PTRACE_KILL: ::c_int = 8;
pub const PTRACE_PEEKDATA: ::c_int = 2;
pub const PTRACE_PEEKTEXT: ::c_int = 1;
pub const PTRACE_PEEKUSER: ::c_int = 3;
pub const PTRACE_POKEDATA: ::c_int = 5;
pub const PTRACE_POKETEXT: ::c_int = 4;
pub const PTRACE_POKEUSER: ::c_int = 6;
pub const PTRACE_SETFPREGS: ::c_int = 13;
pub const PTRACE_SETREGS: ::c_int = 11;
pub const PTRACE_SINGLESTEP: ::c_int = 9;
pub const PTRACE_SYSCALL: ::c_int = 16;
pub const PTRACE_TRACEME: ::c_int = 0;
// sys/resource.h
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_AS: ::c_int = 6;
pub const RLIMIT_NOFILE: ::c_int = 7;
pub const RLIMIT_THREADS: ::c_int = 8;
pub const RLIMIT_NPROC: ::c_int = 9;
pub const RUSAGE_SELF: ::c_int = 0;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
pub const RUSAGE_THREAD: ::c_int = 1;
pub const RLIM_SAVED_MAX: ::c_ulong = RLIM_INFINITY - 1;
pub const RLIM_SAVED_CUR: ::c_ulong = RLIM_INFINITY - 2;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 10;
// sys/sched.h
pub const SCHED_OTHER: ::c_int = 0;
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_RR: ::c_int = 2;
pub const SCHED_LOCAL: ::c_int = 3;
pub const SCHED_GLOBAL: ::c_int = 4;
pub const SCHED_FIFO2: ::c_int = 5;
pub const SCHED_FIFO3: ::c_int = 6;
pub const SCHED_FIFO4: ::c_int = 7;
// sys/sem.h
pub const SEM_UNDO: ::c_int = 0o10000;
pub const GETNCNT: ::c_int = 3;
pub const GETPID: ::c_int = 4;
pub const GETVAL: ::c_int = 5;
pub const GETALL: ::c_int = 6;
pub const GETZCNT: ::c_int = 7;
pub const SETVAL: ::c_int = 8;
pub const SETALL: ::c_int = 9;
// sys/shm.h
pub const SHMLBA: ::c_int = 0x10000000;
pub const SHMLBA_EXTSHM: ::c_int = 0x1000;
pub const SHM_SHMAT: ::c_int = 0x80000000;
pub const SHM_RDONLY: ::c_int = 0o10000;
pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_PIN: ::c_int = 0o4000;
pub const SHM_LGPAGE: ::c_int = 0o20000000000;
pub const SHM_MAP: ::c_int = 0o4000;
pub const SHM_FMAP: ::c_int = 0o2000;
pub const SHM_COPY: ::c_int = 0o40000;
pub const SHM_CLEAR: ::c_int = 0;
pub const SHM_HGSEG: ::c_int = 0o10000000000;
pub const SHM_R: ::c_int = IPC_R;
pub const SHM_W: ::c_int = IPC_W;
pub const SHM_DEST: ::c_int = 0o2000;
// sys/signal.h
pub const SA_ONSTACK: ::c_int = 0x00000001;
pub const SA_RESETHAND: ::c_int = 0x00000002;
pub const SA_RESTART: ::c_int = 0x00000008;
pub const SA_SIGINFO: ::c_int = 0x00000100;
pub const SA_NODEFER: ::c_int = 0x00000200;
pub const SA_NOCLDWAIT: ::c_int = 0x00000400;
pub const SA_NOCLDSTOP: ::c_int = 0x00000004;
pub const SS_ONSTACK: ::c_int = 0x00000001;
pub const SS_DISABLE: ::c_int = 0x00000002;
pub const SIGCHLD: ::c_int = 20;
pub const SIGBUS: ::c_int = 10;
pub const SIG_BLOCK: ::c_int = 0;
pub const SIG_UNBLOCK: ::c_int = 1;
pub const SIG_SETMASK: ::c_int = 2;
pub const SIGEV_NONE: ::c_int = 1;
pub const SIGEV_SIGNAL: ::c_int = 2;
pub const SIGEV_THREAD: ::c_int = 3;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGEMT: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGSYS: ::c_int = 12;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const SIGUSR1: ::c_int = 30;
pub const SIGUSR2: ::c_int = 31;
pub const SIGPWR: ::c_int = 29;
pub const SIGWINCH: ::c_int = 28;
pub const SIGURG: ::c_int = 16;
pub const SIGPOLL: ::c_int = SIGIO;
pub const SIGIO: ::c_int = 23;
pub const SIGSTOP: ::c_int = 17;
pub const SIGTSTP: ::c_int = 18;
pub const SIGCONT: ::c_int = 19;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGVTALRM: ::c_int = 34;
pub const SIGPROF: ::c_int = 32;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGTRAP: ::c_int = 5;
pub const SIGCLD: ::c_int = 20;
pub const SIGRTMAX: ::c_int = 57;
pub const SIGRTMIN: ::c_int = 50;
pub const SI_USER: ::c_int = 0;
pub const SI_UNDEFINED: ::c_int = 8;
pub const SI_EMPTY: ::c_int = 9;
pub const BUS_ADRALN: ::c_int = 1;
pub const BUS_ADRERR: ::c_int = 2;
pub const BUS_OBJERR: ::c_int = 3;
pub const BUS_UEGARD: ::c_int = 4;
pub const CLD_EXITED: ::c_int = 10;
pub const CLD_KILLED: ::c_int = 11;
pub const CLD_DUMPED: ::c_int = 12;
pub const CLD_TRAPPED: ::c_int = 13;
pub const CLD_STOPPED: ::c_int = 14;
pub const CLD_CONTINUED: ::c_int = 15;
pub const FPE_INTDIV: ::c_int = 20;
pub const FPE_INTOVF: ::c_int = 21;
pub const FPE_FLTDIV: ::c_int = 22;
pub const FPE_FLTOVF: ::c_int = 23;
pub const FPE_FLTUND: ::c_int = 24;
pub const FPE_FLTRES: ::c_int = 25;
pub const FPE_FLTINV: ::c_int = 26;
pub const FPE_FLTSUB: ::c_int = 27;
pub const ILL_ILLOPC: ::c_int = 30;
pub const ILL_ILLOPN: ::c_int = 31;
pub const ILL_ILLADR: ::c_int = 32;
pub const ILL_ILLTRP: ::c_int = 33;
pub const ILL_PRVOPC: ::c_int = 34;
pub const ILL_PRVREG: ::c_int = 35;
pub const ILL_COPROC: ::c_int = 36;
pub const ILL_BADSTK: ::c_int = 37;
pub const ILL_TMBADTHING: ::c_int = 38;
pub const POLL_IN: ::c_int = 40;
pub const POLL_OUT: ::c_int = 41;
pub const POLL_MSG: ::c_int = -3;
pub const POLL_ERR: ::c_int = 43;
pub const POLL_PRI: ::c_int = 44;
pub const POLL_HUP: ::c_int = 45;
pub const SEGV_MAPERR: ::c_int = 50;
pub const SEGV_ACCERR: ::c_int = 51;
pub const SEGV_KEYERR: ::c_int = 52;
pub const TRAP_BRKPT: ::c_int = 60;
pub const TRAP_TRACE: ::c_int = 61;
pub const SI_QUEUE: ::c_int = 71;
pub const SI_TIMER: ::c_int = 72;
pub const SI_ASYNCIO: ::c_int = 73;
pub const SI_MESGQ: ::c_int = 74;
// sys/socket.h
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_UNIX: ::c_int = 1;
pub const AF_INET: ::c_int = 2;
pub const AF_IMPLINK: ::c_int = 3;
pub const AF_PUP: ::c_int = 4;
pub const AF_CHAOS: ::c_int = 5;
pub const AF_NS: ::c_int = 6;
pub const AF_ECMA: ::c_int = 8;
pub const AF_DATAKIT: ::c_int = 9;
pub const AF_CCITT: ::c_int = 10;
pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
pub const SO_TIMESTAMPNS: ::c_int = 0x100a;
pub const SOMAXCONN: ::c_int = 1024;
pub const AF_LOCAL: ::c_int = AF_UNIX;
pub const UIO_MAXIOV: ::c_int = 1024;
pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_ISO: ::c_int = 7;
pub const AF_OSI: ::c_int = AF_ISO;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_LINK: ::c_int = 18;
pub const AF_INET6: ::c_int = 24;
pub const AF_INTF: ::c_int = 20;
pub const AF_RIF: ::c_int = 21;
pub const AF_NDD: ::c_int = 23;
pub const AF_MAX: ::c_int = 30;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_UNIX: ::c_int = AF_UNIX;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
pub const PF_PUP: ::c_int = AF_PUP;
pub const PF_CHAOS: ::c_int = AF_CHAOS;
pub const PF_NS: ::c_int = AF_NS;
pub const PF_ISO: ::c_int = AF_ISO;
pub const PF_OSI: ::c_int = AF_ISO;
pub const PF_ECMA: ::c_int = AF_ECMA;
pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
pub const PF_CCITT: ::c_int = AF_CCITT;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_DLI: ::c_int = AF_DLI;
pub const PF_LAT: ::c_int = AF_LAT;
pub const PF_HYLINK: ::c_int = AF_HYLINK;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_ROUTE: ::c_int = AF_ROUTE;
pub const PF_LINK: ::c_int = AF_LINK;
pub const PF_XTP: ::c_int = 19;
pub const PF_RIF: ::c_int = AF_RIF;
pub const PF_INTF: ::c_int = AF_INTF;
pub const PF_NDD: ::c_int = AF_NDD;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_MAX: ::c_int = AF_MAX;
pub const SF_CLOSE: ::c_int = 1;
pub const SF_REUSE: ::c_int = 2;
pub const SF_DONT_CACHE: ::c_int = 4;
pub const SF_SYNC_CACHE: ::c_int = 8;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x0001;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_USELOOPBACK: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_USE_IFBUFS: ::c_int = 0x0400;
pub const SO_CKSUMRECV: ::c_int = 0x0800;
pub const SO_NOREUSEADDR: ::c_int = 0x1000;
pub const SO_KERNACCEPT: ::c_int = 0x2000;
pub const SO_NOMULTIPATH: ::c_int = 0x4000;
pub const SO_AUDIT: ::c_int = 0x8000;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const MSG_OOB: ::c_int = 0x1;
pub const MSG_PEEK: ::c_int = 0x2;
pub const MSG_DONTROUTE: ::c_int = 0x4;
pub const MSG_EOR: ::c_int = 0x8;
pub const MSG_TRUNC: ::c_int = 0x10;
pub const MSG_CTRUNC: ::c_int = 0x20;
pub const MSG_WAITALL: ::c_int = 0x40;
pub const MSG_MPEG2: ::c_int = 0x80;
pub const MSG_NOSIGNAL: ::c_int = 0x100;
pub const MSG_WAITFORONE: ::c_int = 0x200;
pub const MSG_ARGEXT: ::c_int = 0x400;
pub const MSG_NONBLOCK: ::c_int = 0x4000;
pub const MSG_COMPAT: ::c_int = 0x8000;
pub const MSG_MAXIOVLEN: ::c_int = 16;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
// sys/stat.h
pub const UTIME_NOW: ::c_int = -2;
pub const UTIME_OMIT: ::c_int = -3;
// sys/statvfs.h
pub const ST_RDONLY: ::c_ulong = 0x0001;
pub const ST_NOSUID: ::c_ulong = 0x0040;
pub const ST_NODEV: ::c_ulong = 0x0080;
// sys/stropts.h
pub const I_NREAD: ::c_int = 0x20005301;
pub const I_PUSH: ::c_int = 0x20005302;
pub const I_POP: ::c_int = 0x20005303;
pub const I_LOOK: ::c_int = 0x20005304;
pub const I_FLUSH: ::c_int = 0x20005305;
pub const I_SRDOPT: ::c_int = 0x20005306;
pub const I_GRDOPT: ::c_int = 0x20005307;
pub const I_STR: ::c_int = 0x20005308;
pub const I_SETSIG: ::c_int = 0x20005309;
pub const I_GETSIG: ::c_int = 0x2000530a;
pub const I_FIND: ::c_int = 0x2000530b;
pub const I_LINK: ::c_int = 0x2000530c;
pub const I_UNLINK: ::c_int = 0x2000530d;
pub const I_PEEK: ::c_int = 0x2000530f;
pub const I_FDINSERT: ::c_int = 0x20005310;
pub const I_SENDFD: ::c_int = 0x20005311;
pub const I_RECVFD: ::c_int = 0x20005312;
pub const I_SWROPT: ::c_int = 0x20005314;
pub const I_GWROPT: ::c_int = 0x20005315;
pub const I_LIST: ::c_int = 0x20005316;
pub const I_PLINK: ::c_int = 0x2000531d;
pub const I_PUNLINK: ::c_int = 0x2000531e;
pub const I_FLUSHBAND: ::c_int = 0x20005313;
pub const I_CKBAND: ::c_int = 0x20005318;
pub const I_GETBAND: ::c_int = 0x20005319;
pub const I_ATMARK: ::c_int = 0x20005317;
pub const I_SETCLTIME: ::c_int = 0x2000531b;
pub const I_GETCLTIME: ::c_int = 0x2000531c;
pub const I_CANPUT: ::c_int = 0x2000531a;
// sys/syslog.h
pub const LOG_CRON: ::c_int = 9 << 3;
pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_NFACILITIES: ::c_int = 24;
pub const LOG_PERROR: ::c_int = 0x20;
// sys/systemcfg.h
pub const SC_ARCH: ::c_int = 1;
pub const SC_IMPL: ::c_int = 2;
pub const SC_VERS: ::c_int = 3;
pub const SC_WIDTH: ::c_int = 4;
pub const SC_NCPUS: ::c_int = 5;
pub const SC_L1C_ATTR: ::c_int = 6;
pub const SC_L1C_ISZ: ::c_int = 7;
pub const SC_L1C_DSZ: ::c_int = 8;
pub const SC_L1C_ICA: ::c_int = 9;
pub const SC_L1C_DCA: ::c_int = 10;
pub const SC_L1C_IBS: ::c_int = 11;
pub const SC_L1C_DBS: ::c_int = 12;
pub const SC_L1C_ILS: ::c_int = 13;
pub const SC_L1C_DLS: ::c_int = 14;
pub const SC_L2C_SZ: ::c_int = 15;
pub const SC_L2C_AS: ::c_int = 16;
pub const SC_TLB_ATTR: ::c_int = 17;
pub const SC_ITLB_SZ: ::c_int = 18;
pub const SC_DTLB_SZ: ::c_int = 19;
pub const SC_ITLB_ATT: ::c_int = 20;
pub const SC_DTLB_ATT: ::c_int = 21;
pub const SC_RESRV_SZ: ::c_int = 22;
pub const SC_PRI_LC: ::c_int = 23;
pub const SC_PRO_LC: ::c_int = 24;
pub const SC_RTC_TYPE: ::c_int = 25;
pub const SC_VIRT_AL: ::c_int = 26;
pub const SC_CAC_CONG: ::c_int = 27;
pub const SC_MOD_ARCH: ::c_int = 28;
pub const SC_MOD_IMPL: ::c_int = 29;
pub const SC_XINT: ::c_int = 30;
pub const SC_XFRAC: ::c_int = 31;
pub const SC_KRN_ATTR: ::c_int = 32;
pub const SC_PHYSMEM: ::c_int = 33;
pub const SC_SLB_ATTR: ::c_int = 34;
pub const SC_SLB_SZ: ::c_int = 35;
pub const SC_MAX_NCPUS: ::c_int = 37;
pub const SC_MAX_REALADDR: ::c_int = 38;
pub const SC_ORIG_ENT_CAP: ::c_int = 39;
pub const SC_ENT_CAP: ::c_int = 40;
pub const SC_DISP_WHE: ::c_int = 41;
pub const SC_CAPINC: ::c_int = 42;
pub const SC_VCAPW: ::c_int = 43;
pub const SC_SPLP_STAT: ::c_int = 44;
pub const SC_SMT_STAT: ::c_int = 45;
pub const SC_SMT_TC: ::c_int = 46;
pub const SC_VMX_VER: ::c_int = 47;
pub const SC_LMB_SZ: ::c_int = 48;
pub const SC_MAX_XCPU: ::c_int = 49;
pub const SC_EC_LVL: ::c_int = 50;
pub const SC_AME_STAT: ::c_int = 51;
pub const SC_ECO_STAT: ::c_int = 52;
pub const SC_DFP_VER: ::c_int = 53;
pub const SC_VRM_STAT: ::c_int = 54;
pub const SC_PHYS_IMP: ::c_int = 55;
pub const SC_PHYS_VER: ::c_int = 56;
pub const SC_SPCM_STATUS: ::c_int = 57;
pub const SC_SPCM_MAX: ::c_int = 58;
pub const SC_TM_VER: ::c_int = 59;
pub const SC_NX_CAP: ::c_int = 60;
pub const SC_PKS_STATE: ::c_int = 61;
pub const SC_MMA_VER: ::c_int = 62;
pub const POWER_RS: ::c_int = 1;
pub const POWER_PC: ::c_int = 2;
pub const IA64: ::c_int = 3;
pub const POWER_RS1: ::c_int = 0x1;
pub const POWER_RSC: ::c_int = 0x2;
pub const POWER_RS2: ::c_int = 0x4;
pub const POWER_601: ::c_int = 0x8;
pub const POWER_604: ::c_int = 0x10;
pub const POWER_603: ::c_int = 0x20;
pub const POWER_620: ::c_int = 0x40;
pub const POWER_630: ::c_int = 0x80;
pub const POWER_A35: ::c_int = 0x100;
pub const POWER_RS64II: ::c_int = 0x200;
pub const POWER_RS64III: ::c_int = 0x400;
pub const POWER_4: ::c_int = 0x800;
pub const POWER_RS64IV: ::c_int = POWER_4;
pub const POWER_MPC7450: ::c_int = 0x1000;
pub const POWER_5: ::c_int = 0x2000;
pub const POWER_6: ::c_int = 0x4000;
pub const POWER_7: ::c_int = 0x8000;
pub const POWER_8: ::c_int = 0x10000;
pub const POWER_9: ::c_int = 0x20000;
// sys/time.h
pub const FD_SETSIZE: usize = 65534;
pub const TIMEOFDAY: ::c_int = 9;
pub const CLOCK_REALTIME: ::clockid_t = TIMEOFDAY as clockid_t;
pub const CLOCK_MONOTONIC: ::clockid_t = 10;
pub const TIMER_ABSTIME: ::c_int = 999;
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
pub const ITIMER_VIRT: ::c_int = 3;
pub const ITIMER_REAL1: ::c_int = 20;
pub const ITIMER_REAL_TH: ::c_int = ITIMER_REAL1;
pub const DST_AUST: ::c_int = 2;
pub const DST_CAN: ::c_int = 6;
pub const DST_EET: ::c_int = 5;
pub const DST_MET: ::c_int = 4;
pub const DST_NONE: ::c_int = 0;
pub const DST_USA: ::c_int = 1;
pub const DST_WET: ::c_int = 3;
// sys/termio.h
pub const CSTART: ::tcflag_t = 0o21;
pub const CSTOP: ::tcflag_t = 0o23;
pub const TCGETA: ::c_int = TIOC | 5;
pub const TCSETA: ::c_int = TIOC | 6;
pub const TCSETAW: ::c_int = TIOC | 7;
pub const TCSETAF: ::c_int = TIOC | 8;
pub const TCSBRK: ::c_int = TIOC | 9;
pub const TCXONC: ::c_int = TIOC | 11;
pub const TCFLSH: ::c_int = TIOC | 12;
pub const TCGETS: ::c_int = TIOC | 1;
pub const TCSETS: ::c_int = TIOC | 2;
pub const TCSANOW: ::c_int = 0;
pub const TCSETSW: ::c_int = TIOC | 3;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSETSF: ::c_int = TIOC | 4;
pub const TCSAFLUSH: ::c_int = 2;
pub const TCIFLUSH: ::c_int = 0;
pub const TCOFLUSH: ::c_int = 1;
pub const TCIOFLUSH: ::c_int = 2;
pub const TCOOFF: ::c_int = 0;
pub const TCOON: ::c_int = 1;
pub const TCIOFF: ::c_int = 2;
pub const TCION: ::c_int = 3;
pub const TIOC: ::c_int = 0x5400;
pub const TIOCGWINSZ: ::c_int = 0x40087468;
pub const TIOCSWINSZ: ::c_int = 0x80087467;
pub const TIOCLBIS: ::c_int = 0x8004747f;
pub const TIOCLBIC: ::c_int = 0x8004747e;
pub const TIOCLSET: ::c_int = 0x8004747d;
pub const TIOCLGET: ::c_int = 0x4004747c;
pub const TIOCSBRK: ::c_int = 0x2000747b;
pub const TIOCCBRK: ::c_int = 0x2000747a;
pub const TIOCSDTR: ::c_int = 0x20007479;
pub const TIOCCDTR: ::c_int = 0x20007478;
pub const TIOCSLTC: ::c_int = 0x80067475;
pub const TIOCGLTC: ::c_int = 0x40067474;
pub const TIOCOUTQ: ::c_int = 0x40047473;
pub const TIOCNOTTY: ::c_int = 0x20007471;
pub const TIOCSTOP: ::c_int = 0x2000746f;
pub const TIOCSTART: ::c_int = 0x2000746e;
pub const TIOCGPGRP: ::c_int = 0x40047477;
pub const TIOCSPGRP: ::c_int = 0x80047476;
pub const TIOCGSID: ::c_int = 0x40047448;
pub const TIOCSTI: ::c_int = 0x80017472;
pub const TIOCMSET: ::c_int = 0x8004746d;
pub const TIOCMBIS: ::c_int = 0x8004746c;
pub const TIOCMBIC: ::c_int = 0x8004746b;
pub const TIOCMGET: ::c_int = 0x4004746a;
pub const TIOCREMOTE: ::c_int = 0x80047469;
// sys/user.h
pub const MAXCOMLEN: ::c_int = 32;
pub const UF_SYSTEM: ::c_int = 0x1000;
// sys/vattr.h
pub const AT_FLAGS: ::c_int = 0x80;
pub const AT_GID: ::c_int = 8;
pub const AT_UID: ::c_int = 4;
// sys/wait.h
pub const P_ALL: ::c_int = 0;
pub const P_PID: ::c_int = 1;
pub const P_PGID: ::c_int = 2;
pub const WNOHANG: ::c_int = 0x1;
pub const WUNTRACED: ::c_int = 0x2;
pub const WEXITED: ::c_int = 0x04;
pub const WCONTINUED: ::c_int = 0x01000000;
pub const WNOWAIT: ::c_int = 0x10;
pub const WSTOPPED: ::c_int = _W_STOPPED;
pub const _W_STOPPED: ::c_int = 0x00000040;
pub const _W_SLWTED: ::c_int = 0x0000007c;
pub const _W_SEWTED: ::c_int = 0x0000007d;
pub const _W_SFWTED: ::c_int = 0x0000007e;
pub const _W_STRC: ::c_int = 0x0000007f;
// termios.h
pub const NCCS: usize = 16;
pub const OLCUC: ::tcflag_t = 2;
pub const CSIZE: ::tcflag_t = 0x00000030;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CS6: ::tcflag_t = 0x00000010;
pub const CS7: ::tcflag_t = 0x00000020;
pub const CS8: ::tcflag_t = 0x00000030;
pub const CSTOPB: ::tcflag_t = 0x00000040;
pub const ECHO: ::tcflag_t = 0x20000;
pub const ECHOE: ::tcflag_t = 0x00000010;
pub const ECHOK: ::tcflag_t = 0x00000020;
pub const ECHONL: ::tcflag_t = 0x00000040;
pub const ECHOCTL: ::tcflag_t = 0x00020000;
pub const ECHOPRT: ::tcflag_t = 0x00040000;
pub const ECHOKE: ::tcflag_t = 0x00080000;
pub const IGNBRK: ::tcflag_t = 0x00000001;
pub const BRKINT: ::tcflag_t = 0x00000002;
pub const IGNPAR: ::tcflag_t = 0x00000004;
pub const PARMRK: ::tcflag_t = 0x00000008;
pub const INPCK: ::tcflag_t = 0x00000010;
pub const ISTRIP: ::tcflag_t = 0x00000020;
pub const INLCR: ::tcflag_t = 0x00000040;
pub const IGNCR: ::tcflag_t = 0x00000080;
pub const ICRNL: ::tcflag_t = 0x00000100;
pub const IXON: ::tcflag_t = 0x0001;
pub const IXOFF: ::tcflag_t = 0x00000400;
pub const IXANY: ::tcflag_t = 0x00001000;
pub const IMAXBEL: ::tcflag_t = 0x00010000;
pub const OPOST: ::tcflag_t = 0x00000001;
pub const ONLCR: ::tcflag_t = 0x00000004;
pub const OCRNL: ::tcflag_t = 0x00000008;
pub const ONOCR: ::tcflag_t = 0x00000010;
pub const ONLRET: ::tcflag_t = 0x00000020;
pub const CREAD: ::tcflag_t = 0x00000080;
pub const IEXTEN: ::tcflag_t = 0x00200000;
pub const TOSTOP: ::tcflag_t = 0x00010000;
pub const FLUSHO: ::tcflag_t = 0x00100000;
pub const PENDIN: ::tcflag_t = 0x20000000;
pub const NOFLSH: ::tcflag_t = 0x00000080;
pub const VINTR: usize = 0;
pub const VQUIT: usize = 1;
pub const VERASE: usize = 2;
pub const VKILL: usize = 3;
pub const VEOF: usize = 4;
pub const VEOL: usize = 5;
pub const VSTART: usize = 7;
pub const VSTOP: usize = 8;
pub const VSUSP: usize = 9;
pub const VMIN: usize = 4;
pub const VTIME: usize = 5;
pub const VEOL2: usize = 6;
pub const VDSUSP: usize = 10;
pub const VREPRINT: usize = 11;
pub const VDISCRD: usize = 12;
pub const VWERSE: usize = 13;
pub const VLNEXT: usize = 14;
pub const B0: ::speed_t = 0x0;
pub const B50: ::speed_t = 0x1;
pub const B75: ::speed_t = 0x2;
pub const B110: ::speed_t = 0x3;
pub const B134: ::speed_t = 0x4;
pub const B150: ::speed_t = 0x5;
pub const B200: ::speed_t = 0x6;
pub const B300: ::speed_t = 0x7;
pub const B600: ::speed_t = 0x8;
pub const B1200: ::speed_t = 0x9;
pub const B1800: ::speed_t = 0xa;
pub const B2400: ::speed_t = 0xb;
pub const B4800: ::speed_t = 0xc;
pub const B9600: ::speed_t = 0xd;
pub const B19200: ::speed_t = 0xe;
pub const B38400: ::speed_t = 0xf;
pub const EXTA: ::speed_t = B19200;
pub const EXTB: ::speed_t = B38400;
pub const IUCLC: ::tcflag_t = 0x00000800;
pub const OFILL: ::tcflag_t = 0x00000040;
pub const OFDEL: ::tcflag_t = 0x00000080;
pub const CRDLY: ::tcflag_t = 0x00000300;
pub const CR0: ::tcflag_t = 0x00000000;
pub const CR1: ::tcflag_t = 0x00000100;
pub const CR2: ::tcflag_t = 0x00000200;
pub const CR3: ::tcflag_t = 0x00000300;
pub const TABDLY: ::tcflag_t = 0x00000c00;
pub const TAB0: ::tcflag_t = 0x00000000;
pub const TAB1: ::tcflag_t = 0x00000400;
pub const TAB2: ::tcflag_t = 0x00000800;
pub const TAB3: ::tcflag_t = 0x00000c00;
pub const BSDLY: ::tcflag_t = 0x00001000;
pub const BS0: ::tcflag_t = 0x00000000;
pub const BS1: ::tcflag_t = 0x00001000;
pub const FFDLY: ::tcflag_t = 0x00002000;
pub const FF0: ::tcflag_t = 0x00000000;
pub const FF1: ::tcflag_t = 0x00002000;
pub const NLDLY: ::tcflag_t = 0x00004000;
pub const NL0: ::tcflag_t = 0x00000000;
pub const NL1: ::tcflag_t = 0x00004000;
pub const VTDLY: ::tcflag_t = 0x00008000;
pub const VT0: ::tcflag_t = 0x00000000;
pub const VT1: ::tcflag_t = 0x00008000;
pub const OXTABS: ::tcflag_t = 0x00040000;
pub const ONOEOT: ::tcflag_t = 0x00080000;
pub const CBAUD: ::tcflag_t = 0x0000000f;
pub const PARENB: ::tcflag_t = 0x00000100;
pub const PARODD: ::tcflag_t = 0x00000200;
pub const HUPCL: ::tcflag_t = 0x00000400;
pub const CLOCAL: ::tcflag_t = 0x00000800;
pub const CIBAUD: ::tcflag_t = 0x000f0000;
pub const IBSHIFT: ::tcflag_t = 16;
pub const PAREXT: ::tcflag_t = 0x00100000;
pub const ISIG: ::tcflag_t = 0x00000001;
pub const ICANON: ::tcflag_t = 0x00000002;
pub const XCASE: ::tcflag_t = 0x00000004;
pub const ALTWERASE: ::tcflag_t = 0x00400000;
// time.h
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 11;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 12;
// unistd.h
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const _POSIX_VDISABLE: ::c_int = 0xff;
pub const _PC_LINK_MAX: ::c_int = 11;
pub const _PC_MAX_CANON: ::c_int = 12;
pub const _PC_MAX_INPUT: ::c_int = 13;
pub const _PC_NAME_MAX: ::c_int = 14;
pub const _PC_PATH_MAX: ::c_int = 16;
pub const _PC_PIPE_BUF: ::c_int = 17;
pub const _PC_NO_TRUNC: ::c_int = 15;
pub const _PC_VDISABLE: ::c_int = 18;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 10;
pub const _PC_ASYNC_IO: ::c_int = 19;
pub const _PC_PRIO_IO: ::c_int = 21;
pub const _PC_SYNC_IO: ::c_int = 20;
pub const _PC_ALLOC_SIZE_MIN: ::c_int = 26;
pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 27;
pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 28;
pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 29;
pub const _PC_REC_XFER_ALIGN: ::c_int = 30;
pub const _PC_SYMLINK_MAX: ::c_int = 25;
pub const _PC_2_SYMLINKS: ::c_int = 31;
pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 32;
pub const _PC_FILESIZEBITS: ::c_int = 22;
pub const _SC_ARG_MAX: ::c_int = 0;
pub const _SC_CHILD_MAX: ::c_int = 1;
pub const _SC_CLK_TCK: ::c_int = 2;
pub const _SC_NGROUPS_MAX: ::c_int = 3;
pub const _SC_OPEN_MAX: ::c_int = 4;
pub const _SC_JOB_CONTROL: ::c_int = 7;
pub const _SC_SAVED_IDS: ::c_int = 8;
pub const _SC_VERSION: ::c_int = 9;
pub const _SC_PASS_MAX: ::c_int = 45;
pub const _SC_PAGESIZE: ::c_int = _SC_PAGE_SIZE;
pub const _SC_PAGE_SIZE: ::c_int = 48;
pub const _SC_XOPEN_VERSION: ::c_int = 46;
pub const _SC_NPROCESSORS_CONF: ::c_int = 71;
pub const _SC_NPROCESSORS_ONLN: ::c_int = 72;
pub const _SC_STREAM_MAX: ::c_int = 5;
pub const _SC_TZNAME_MAX: ::c_int = 6;
pub const _SC_AIO_LISTIO_MAX: ::c_int = 75;
pub const _SC_AIO_MAX: ::c_int = 76;
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 77;
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 78;
pub const _SC_DELAYTIMER_MAX: ::c_int = 79;
pub const _SC_FSYNC: ::c_int = 80;
pub const _SC_MAPPED_FILES: ::c_int = 84;
pub const _SC_MEMLOCK: ::c_int = 85;
pub const _SC_MEMLOCK_RANGE: ::c_int = 86;
pub const _SC_MEMORY_PROTECTION: ::c_int = 87;
pub const _SC_MESSAGE_PASSING: ::c_int = 88;
pub const _SC_MQ_OPEN_MAX: ::c_int = 89;
pub const _SC_MQ_PRIO_MAX: ::c_int = 90;
pub const _SC_PRIORITIZED_IO: ::c_int = 91;
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 92;
pub const _SC_REALTIME_SIGNALS: ::c_int = 93;
pub const _SC_RTSIG_MAX: ::c_int = 94;
pub const _SC_SEMAPHORES: ::c_int = 95;
pub const _SC_SEM_NSEMS_MAX: ::c_int = 96;
pub const _SC_SEM_VALUE_MAX: ::c_int = 97;
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 98;
pub const _SC_SIGQUEUE_MAX: ::c_int = 99;
pub const _SC_SYNCHRONIZED_IO: ::c_int = 100;
pub const _SC_TIMERS: ::c_int = 102;
pub const _SC_TIMER_MAX: ::c_int = 103;
pub const _SC_2_C_BIND: ::c_int = 51;
pub const _SC_2_C_DEV: ::c_int = 32;
pub const _SC_2_C_VERSION: ::c_int = 52;
pub const _SC_2_FORT_DEV: ::c_int = 33;
pub const _SC_2_FORT_RUN: ::c_int = 34;
pub const _SC_2_LOCALEDEF: ::c_int = 35;
pub const _SC_2_SW_DEV: ::c_int = 36;
pub const _SC_2_UPE: ::c_int = 53;
pub const _SC_2_VERSION: ::c_int = 31;
pub const _SC_BC_BASE_MAX: ::c_int = 23;
pub const _SC_BC_DIM_MAX: ::c_int = 24;
pub const _SC_BC_SCALE_MAX: ::c_int = 25;
pub const _SC_BC_STRING_MAX: ::c_int = 26;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 50;
pub const _SC_EXPR_NEST_MAX: ::c_int = 28;
pub const _SC_LINE_MAX: ::c_int = 29;
pub const _SC_RE_DUP_MAX: ::c_int = 30;
pub const _SC_XOPEN_CRYPT: ::c_int = 56;
pub const _SC_XOPEN_ENH_I18N: ::c_int = 57;
pub const _SC_XOPEN_SHM: ::c_int = 55;
pub const _SC_2_CHAR_TERM: ::c_int = 54;
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 109;
pub const _SC_ATEXIT_MAX: ::c_int = 47;
pub const _SC_IOV_MAX: ::c_int = 58;
pub const _SC_XOPEN_UNIX: ::c_int = 73;
pub const _SC_T_IOV_MAX: ::c_int = 0;
pub const _SC_PHYS_PAGES: ::c_int = 113;
pub const _SC_AVPHYS_PAGES: ::c_int = 114;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 101;
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 81;
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 82;
pub const _SC_LOGIN_NAME_MAX: ::c_int = 83;
pub const _SC_THREAD_KEYS_MAX: ::c_int = 68;
pub const _SC_THREAD_STACK_MIN: ::c_int = 69;
pub const _SC_THREAD_THREADS_MAX: ::c_int = 70;
pub const _SC_TTY_NAME_MAX: ::c_int = 104;
pub const _SC_THREADS: ::c_int = 60;
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61;
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62;
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 64;
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 65;
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 66;
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 67;
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 59;
pub const _SC_XOPEN_LEGACY: ::c_int = 112;
pub const _SC_XOPEN_REALTIME: ::c_int = 110;
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 111;
pub const _SC_XBS5_ILP32_OFF32: ::c_int = 105;
pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 106;
pub const _SC_XBS5_LP64_OFF64: ::c_int = 107;
pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 108;
pub const _SC_2_PBS: ::c_int = 132;
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 133;
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 134;
pub const _SC_2_PBS_LOCATE: ::c_int = 135;
pub const _SC_2_PBS_MESSAGE: ::c_int = 136;
pub const _SC_2_PBS_TRACK: ::c_int = 137;
pub const _SC_ADVISORY_INFO: ::c_int = 130;
pub const _SC_BARRIERS: ::c_int = 138;
pub const _SC_CLOCK_SELECTION: ::c_int = 139;
pub const _SC_CPUTIME: ::c_int = 140;
pub const _SC_HOST_NAME_MAX: ::c_int = 126;
pub const _SC_MONOTONIC_CLOCK: ::c_int = 141;
pub const _SC_READER_WRITER_LOCKS: ::c_int = 142;
pub const _SC_REGEXP: ::c_int = 127;
pub const _SC_SHELL: ::c_int = 128;
pub const _SC_SPAWN: ::c_int = 143;
pub const _SC_SPIN_LOCKS: ::c_int = 144;
pub const _SC_SPORADIC_SERVER: ::c_int = 145;
pub const _SC_SS_REPL_MAX: ::c_int = 156;
pub const _SC_SYMLOOP_MAX: ::c_int = 129;
pub const _SC_THREAD_CPUTIME: ::c_int = 146;
pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 147;
pub const _SC_TIMEOUTS: ::c_int = 148;
pub const _SC_TRACE: ::c_int = 149;
pub const _SC_TRACE_EVENT_FILTER: ::c_int = 150;
pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 157;
pub const _SC_TRACE_INHERIT: ::c_int = 151;
pub const _SC_TRACE_LOG: ::c_int = 152;
pub const _SC_TRACE_NAME_MAX: ::c_int = 158;
pub const _SC_TRACE_SYS_MAX: ::c_int = 159;
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 160;
pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 153;
pub const _SC_V6_ILP32_OFF32: ::c_int = 121;
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 122;
pub const _SC_V6_LP64_OFF64: ::c_int = 123;
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 124;
pub const _SC_XOPEN_STREAMS: ::c_int = 125;
pub const _SC_IPV6: ::c_int = 154;
pub const _SC_RAW_SOCKETS: ::c_int = 155;
// utmp.h
pub const EMPTY: ::c_short = -1;
pub const RUN_LVL: ::c_short = 1;
pub const BOOT_TIME: ::c_short = 2;
pub const OLD_TIME: ::c_short = 3;
pub const NEW_TIME: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const USER_PROCESS: ::c_short = 7;
pub const DEAD_PROCESS: ::c_short = 8;
pub const ACCOUNTING: ::c_short = 9;
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::() {
(*mhdr).msg_control as *mut cmsghdr
} else {
0 as *mut cmsghdr
}
}
pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr {
if cmsg.is_null() {
CMSG_FIRSTHDR(mhdr)
} else {
if (cmsg as usize + (*cmsg).cmsg_len as usize + ::mem::size_of::<::cmsghdr>()) >
((*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize) {
0 as *mut ::cmsghdr
} else {
// AIX does not have any alignment/padding for ancillary data, so we don't need _CMSG_ALIGN here.
(cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr
}
}
}
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar).offset(::mem::size_of::<::cmsghdr>() as isize)
}
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
::mem::size_of::<::cmsghdr>() as ::c_uint + length
}
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
::mem::size_of::<::cmsghdr>() as ::c_uint + length
}
pub fn FD_ZERO(set: *mut fd_set) -> () {
for slot in (*set).fds_bits.iter_mut() {
*slot = 0;
}
}
pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of::<::c_long>() * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] |= 1 << (fd % bits);
return
}
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of::<::c_long>() * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
return
}
pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of::<::c_long>() * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
}
pub fn major(dev: ::dev_t) -> ::c_uint {
let x = dev >> 16;
x as ::c_uint
}
pub fn minor(dev: ::dev_t) -> ::c_uint {
let y = dev & 0xFFFF;
y as ::c_uint
}
pub fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= major << 16;
dev |= minor;
dev
}
}
safe_f! {
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & _W_STOPPED) != 0
}
pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
if WIFSTOPPED(status) {
(((status as ::c_uint) >> 8) & 0xff) as ::c_int
} else {
-1
}
}
pub {const} fn WIFEXITED(status: ::c_int) -> bool {
(status & 0xFF) == 0
}
pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
if WIFEXITED(status) {
(((status as ::c_uint) >> 8) & 0xff) as ::c_int
} else {
-1
}
}
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
!WIFEXITED(status) && !WIFSTOPPED(status)
}
pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
if WIFSIGNALED(status) {
(((status as ::c_uint) >> 16) & 0xff) as ::c_int
} else {
-1
}
}
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
(status & WCONTINUED) != 0
}
// AIX doesn't have native WCOREDUMP.
pub {const} fn WCOREDUMP(_status: ::c_int) -> bool {
false
}
}
#[link(name = "thread")]
extern "C" {
pub fn thr_kill(id: thread_t, sig: ::c_int) -> ::c_int;
pub fn thr_self() -> thread_t;
}
#[link(name = "pthread")]
extern "C" {
pub fn pthread_atfork(
prepare: ::Option,
parent: ::Option,
child: ::Option,
) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn pthread_attr_getschedparam(
attr: *const ::pthread_attr_t,
param: *mut sched_param,
) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setschedparam(
attr: *mut ::pthread_attr_t,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_barrier_init(
barrier: *mut pthread_barrier_t,
attr: *const ::pthread_barrierattr_t,
count: ::c_uint,
) -> ::c_int;
pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
pub fn pthread_barrierattr_getpshared(
attr: *const ::pthread_barrierattr_t,
shared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
pub fn pthread_barrierattr_setpshared(
attr: *mut ::pthread_barrierattr_t,
shared: ::c_int,
) -> ::c_int;
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_condattr_getclock(
attr: *const pthread_condattr_t,
clock_id: *mut clockid_t,
) -> ::c_int;
pub fn pthread_condattr_getpshared(
attr: *const pthread_condattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn pthread_getschedparam(
thread: ::pthread_t,
policy: *mut ::c_int,
param: *mut sched_param,
) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, signal: ::c_int) -> ::c_int;
pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_mutexattr_getprotocol(
attr: *const pthread_mutexattr_t,
protocol: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_getpshared(
attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_getrobust(
attr: *mut ::pthread_mutexattr_t,
robust: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setprotocol(
attr: *mut pthread_mutexattr_t,
protocol: ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setpshared(
attr: *mut pthread_mutexattr_t,
pshared: ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setrobust(
attr: *mut ::pthread_mutexattr_t,
robust: ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_getpshared(
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
pub fn pthread_setschedparam(
thread: ::pthread_t,
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_setschedprio(native: ::pthread_t, priority: ::c_int) -> ::c_int;
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
}
#[link(name = "iconv")]
extern "C" {
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
inbytesleft: *mut ::size_t,
outbuf: *mut *mut ::c_char,
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
}
extern "C" {
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn aio_cancel(fildes: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *mut ::aiocb) -> ::c_int;
#[link_name = "_posix_aio_fsync"]
pub fn aio_fsync(op: ::c_int, aiocbp: *mut ::aiocb) -> ::c_int;
pub fn aio_read(aiocbp: *mut ::aiocb) -> ::c_int;
// pub fn aio_suspend
// pub fn aio_write
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn clearenv() -> ::c_int;
pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn drand48() -> ::c_double;
pub fn duplocale(arg1: ::locale_t) -> ::locale_t;
pub fn endgrent();
pub fn endmntent(streamp: *mut ::FILE) -> ::c_int;
pub fn endpwent();
pub fn endutent();
pub fn endutxent();
pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn fattach(fildes: ::c_int, path: *const ::c_char) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn fexecve(
fd: ::c_int,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn ffs(value: ::c_int) -> ::c_int;
pub fn ffsl(value: ::c_long) -> ::c_int;
pub fn ffsll(value: ::c_longlong) -> ::c_int;
pub fn fgetgrent(file: *mut ::FILE) -> *mut ::group;
pub fn fgetpos64(stream: *mut ::FILE, ptr: *mut fpos64_t) -> ::c_int;
pub fn fgetpwent(file: *mut ::FILE) -> *mut ::passwd;
pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn freelocale(loc: ::locale_t);
pub fn freopen64(
filename: *const c_char,
mode: *const c_char,
file: *mut ::FILE,
) -> *mut ::FILE;
pub fn fseeko64(stream: *mut ::FILE, offset: ::off64_t, whence: ::c_int) -> ::c_int;
pub fn fsetpos64(stream: *mut ::FILE, ptr: *const fpos64_t) -> ::c_int;
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn fstatfs64(fd: ::c_int, buf: *mut statfs64) -> ::c_int;
pub fn fstatvfs64(fd: ::c_int, buf: *mut statvfs64) -> ::c_int;
pub fn ftello64(stream: *mut ::FILE) -> ::off64_t;
pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn getcontext(ucp: *mut ucontext_t) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
pub fn getgrent() -> *mut ::group;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn getgrset(user: *mut ::c_char) -> *mut ::c_char;
pub fn gethostid() -> ::c_long;
pub fn getmntent(stream: *mut ::FILE) -> *mut ::mntent;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::size_t,
host: *mut ::c_char,
hostlen: ::size_t,
serv: *mut ::c_char,
servlen: ::size_t,
flags: ::c_int,
) -> ::c_int;
pub fn getpagesize() -> ::c_int;
pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn getpwent() -> *mut ::passwd;
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
pub fn getpwuid_r(
uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
pub fn getutent() -> *mut utmp;
pub fn getutid(u: *const utmp) -> *mut utmp;
pub fn getutline(u: *const utmp) -> *mut utmp;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
pub fn globfree(pglob: *mut ::glob_t);
pub fn hasmntopt(mnt: *const ::mntent, opt: *const ::c_char) -> *mut ::c_char;
pub fn hcreate(nelt: ::size_t) -> ::c_int;
pub fn hdestroy();
pub fn hsearch(entry: entry, action: ::c_int) -> *mut entry;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn if_nameindex() -> *mut if_nameindex;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn ioctl(fildes: ::c_int, request: ::c_int, ...) -> ::c_int;
pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn lcong48(p: *mut ::c_ushort);
pub fn lfind(
key: *const ::c_void,
base: *const ::c_void,
nelp: *mut ::size_t,
width: ::size_t,
compar: ::Option ::c_int>,
) -> *mut ::c_void;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
pub fn loadquery(flags: ::c_int, buf: *mut ::c_char, buflen: ::c_uint) -> ::c_int;
pub fn lpar_get_info(command: ::c_int, buf: *mut ::c_void, bufsize: ::size_t) -> ::c_int;
pub fn lpar_set_resources(id: ::c_int, resource: *mut ::c_void) -> ::c_int;
pub fn lrand48() -> c_long;
pub fn lsearch(
key: *const ::c_void,
base: *mut ::c_void,
nelp: *mut ::size_t,
width: ::size_t,
compar: ::Option ::c_int>,
) -> *mut ::c_void;
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
pub fn lstat64(path: *const c_char, buf: *mut stat64) -> ::c_int;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn makecontext(ucp: *mut ::ucontext_t, func: extern "C" fn(), argc: ::c_int, ...);
pub fn mallinfo() -> ::mallinfo;
pub fn mallopt(param: ::c_int, value: ::c_int) -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn mount(device: *const ::c_char, path: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
pub fn mq_receive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
) -> ::ssize_t;
pub fn mq_send(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
) -> ::c_int;
pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
pub fn mq_timedreceive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
abs_timeout: *const ::timespec,
) -> ::ssize_t;
pub fn mq_timedsend(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
pub fn mrand48() -> c_long;
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn msgsnd(
msqid: ::c_int,
msgp: *const ::c_void,
msgsz: ::size_t,
msgflg: ::c_int,
) -> ::c_int;
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
pub fn nl_langinfo_l(item: ::nl_item, loc: ::locale_t) -> *mut ::c_char;
pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn open64(path: *const c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn pollset_create(maxfd: ::c_int) -> pollset_t;
pub fn pollset_ctl(
ps: pollset_t,
pollctl_array: *mut poll_ctl,
array_length: ::c_int,
) -> ::c_int;
pub fn pollset_destroy(ps: pollset_t) -> ::c_int;
pub fn pollset_poll(
ps: pollset_t,
polldata_array: *mut ::pollfd,
array_length: ::c_int,
timeout: ::c_int,
) -> ::c_int;
pub fn pollset_query(ps: pollset_t, pollfd_query: *mut ::pollfd) -> ::c_int;
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn posix_fadvise64(
fd: ::c_int,
offset: ::off64_t,
len: ::off64_t,
advise: ::c_int,
) -> ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn posix_fallocate64(fd: ::c_int, offset: ::off64_t, len: ::off64_t) -> ::c_int;
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn posix_spawn(
pid: *mut ::pid_t,
path: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawn_file_actions_addclose(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_adddup2(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_addopen(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
path: *const ::c_char,
oflag: ::c_int,
mode: ::mode_t,
) -> ::c_int;
pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_getflags(
attr: *const posix_spawnattr_t,
flags: *mut ::c_short,
) -> ::c_int;
pub fn posix_spawnattr_getpgroup(
attr: *const posix_spawnattr_t,
flags: *mut ::pid_t,
) -> ::c_int;
pub fn posix_spawnattr_getschedparam(
attr: *const posix_spawnattr_t,
param: *mut ::sched_param,
) -> ::c_int;
pub fn posix_spawnattr_getschedpolicy(
attr: *const posix_spawnattr_t,
flags: *mut ::c_int,
) -> ::c_int;
pub fn posix_spawnattr_getsigdefault(
attr: *const posix_spawnattr_t,
default: *mut sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
pub fn posix_spawnattr_setschedparam(
attr: *mut posix_spawnattr_t,
param: *const ::sched_param,
) -> ::c_int;
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnp(
pid: *mut ::pid_t,
file: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn pread64(fd: ::c_int, buf: *mut ::c_void, count: ::size_t, offset: off64_t) -> ::ssize_t;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn ptrace64(
request: ::c_int,
id: ::c_longlong,
addr: ::c_longlong,
data: ::c_int,
buff: *mut ::c_int,
) -> ::c_int;
pub fn pututline(u: *const utmp) -> *mut utmp;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
pub fn pwrite64(
fd: ::c_int,
buf: *const ::c_void,
count: ::size_t,
offset: off64_t,
) -> ::ssize_t;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
#[link_name = "__linux_quotactl"]
pub fn quotactl(
cmd: ::c_int,
special: *const ::c_char,
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
pub fn rand() -> ::c_int;
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
len: ::size_t,
flags: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn recvmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;
pub fn recvmsg(sockfd: ::c_int, msg: *mut msghdr, flags: ::c_int) -> ::ssize_t;
pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regerror(
errcode: ::c_int,
preg: *const ::regex_t,
errbuf: *mut ::c_char,
errbuf_size: ::size_t,
) -> ::size_t;
pub fn regexec(
preg: *const regex_t,
input: *const ::c_char,
nmatch: ::size_t,
pmatch: *mut regmatch_t,
eflags: ::c_int,
) -> ::c_int;
pub fn regfree(preg: *mut regex_t);
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn sched_rr_get_interval(pid: ::pid_t, tp: *mut ::timespec) -> ::c_int;
pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,
policy: ::c_int,
param: *const ::sched_param,
) -> ::c_int;
pub fn sctp_opt_info(
sd: ::c_int,
id: ::sctp_assoc_t,
opt: ::c_int,
arg_size: *mut ::c_void,
size: *mut ::size_t,
) -> ::c_int;
pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn semget(key: ::key_t, nsems: ::c_int, semflag: ::c_int) -> ::c_int;
pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn send_file(socket: *mut ::c_int, iobuf: *mut sf_parms, flags: ::c_uint) -> ::ssize_t;
pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn sendmsg(sockfd: ::c_int, msg: *const msghdr, flags: ::c_int) -> ::ssize_t;
pub fn setcontext(ucp: *const ucontext_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn setgrent();
pub fn sethostid(hostid: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn setmntent(filename: *const ::c_char, ty: *const ::c_char) -> *mut ::FILE;
pub fn setpriority(which: ::c_int, who: id_t, priority: ::c_int) -> ::c_int;
pub fn setpwent();
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
pub fn setrlimit64(resource: ::c_int, rlim: *const rlimit64) -> ::c_int;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn setitimer(
which: ::c_int,
new_value: *const ::itimerval,
old_value: *mut ::itimerval,
) -> ::c_int;
pub fn setutent();
pub fn setutxent();
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
pub fn splice(socket1: ::c_int, socket2: ::c_int, flags: ::c_int) -> ::c_int;
pub fn srand(seed: ::c_uint);
pub fn srand48(seed: ::c_long);
pub fn stat64(path: *const ::c_char, buf: *mut stat64) -> ::c_int;
pub fn stat64at(
dirfd: ::c_int,
path: *const ::c_char,
buf: *mut stat64,
flags: ::c_int,
) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn statfs64(path: *const ::c_char, buf: *mut statfs64) -> ::c_int;
pub fn statvfs64(path: *const ::c_char, buf: *mut statvfs64) -> ::c_int;
pub fn statx(
path: *const ::c_char,
buf: *mut stat,
length: ::c_int,
command: ::c_int,
) -> ::c_int;
pub fn strcasecmp_l(
string1: *const ::c_char,
string2: *const ::c_char,
locale: ::locale_t,
) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn strftime(
arg1: *mut c_char,
arg2: ::size_t,
arg3: *const c_char,
arg4: *const tm,
) -> ::size_t;
pub fn strncasecmp_l(
string1: *const ::c_char,
string2: *const ::c_char,
length: ::size_t,
locale: ::locale_t,
) -> ::c_int;
pub fn strptime(s: *const ::c_char, format: *const ::c_char, tm: *mut ::tm) -> *mut ::c_char;
pub fn strsep(string: *mut *mut ::c_char, delim: *const ::c_char) -> *mut ::c_char;
pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> ::c_int;
pub fn swapoff(puath: *const ::c_char) -> ::c_int;
pub fn swapon(path: *const ::c_char) -> ::c_int;
pub fn sync();
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
pub fn timer_create(
clockid: ::clockid_t,
sevp: *mut ::sigevent,
timerid: *mut ::timer_t,
) -> ::c_int;
pub fn timer_delete(timerid: timer_t) -> ::c_int;
pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
pub fn timer_settime(
timerid: ::timer_t,
flags: ::c_int,
new_value: *const ::itimerspec,
old_value: *mut ::itimerspec,
) -> ::c_int;
pub fn truncate64(path: *const c_char, length: off64_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn updwtmp(file: *const ::c_char, u: *mut utmp);
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn utmpname(file: *const ::c_char) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn wait4(
pid: ::pid_t,
status: *mut ::c_int,
options: ::c_int,
rusage: *mut ::rusage,
) -> ::pid_t;
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
-> ::c_int;
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
// Use AIX thread-safe version errno.
pub fn _Errno() -> *mut ::c_int;
}
cfg_if! {
if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
}
}
libc-0.2.152/src/unix/aix/powerpc64.rs 0000644 0000000 0000000 00000054524 10461020230 0015450 0 ustar 0000000 0000000 pub type c_long = i64;
pub type c_ulong = u64;
s! {
pub struct sigset_t {
pub ss_set: [c_ulong; 4],
}
pub struct fd_set {
pub fds_bits: [c_long; 1024],
}
pub struct flock {
pub l_type: ::c_short,
pub l_whence: ::c_short,
pub l_sysid: ::c_uint,
pub l_pid: ::pid_t,
pub l_vfs: ::c_int,
pub l_start: ::off_t,
pub l_len: ::off_t,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_basetype: [::c_char; 16],
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_fstr: [::c_char; 32],
pub f_filler: [::c_ulong; 16]
}
pub struct pthread_rwlock_t {
__rw_word: [::c_long; 10],
}
pub struct pthread_cond_t {
__cv_word: [::c_long; 6],
}
pub struct pthread_mutex_t {
__mt_word: [::c_long; 8],
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_flag: ::c_ushort,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_ssize: ::c_int,
pub st_atime: ::st_timespec,
pub st_mtime: ::st_timespec,
pub st_ctime: ::st_timespec,
pub st_blksize: ::blksize_t,
pub st_blocks: ::blkcnt_t,
pub st_vfstype: ::c_int,
pub st_vfs: ::c_uint,
pub st_type: ::c_uint,
pub st_gen: ::c_uint,
pub st_reserved: [::c_uint; 9],
pub st_padto_ll: ::c_uint,
pub st_size: ::off_t,
}
pub struct statfs {
pub f_version: ::c_int,
pub f_type: ::c_int,
pub f_bsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsblkcnt_t,
pub f_ffree: ::fsblkcnt_t,
pub f_fsid: ::fsid64_t,
pub f_vfstype: ::c_int,
pub f_fsize: ::c_ulong,
pub f_vfsnumber: ::c_int,
pub f_vfsoff: ::c_int,
pub f_vfslen: ::c_int,
pub f_vfsvers: ::c_int,
pub f_fname: [::c_char; 32],
pub f_fpack: [::c_char; 32],
pub f_name_max: ::c_int,
}
pub struct aiocb {
pub aio_lio_opcode: ::c_int,
pub aio_fildes: ::c_int,
pub aio_word1: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_return: ::ssize_t,
pub aio_errno: ::c_int,
pub aio_nbytes: ::size_t,
pub aio_reqprio: ::c_int,
pub aio_sigevent: ::sigevent,
pub aio_word2: ::c_int,
pub aio_fp: ::c_int,
pub aio_handle: *mut aiocb,
pub aio_reserved: [::c_uint; 2],
pub aio_sigev_tid: c_long,
}
pub struct ucontext_t {
pub __sc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub __sc_uerror: ::c_int,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ucontext_t,
pub uc_stack: ::stack_t,
// Should be pointer to __extctx_t
pub __extctx: *mut ::c_void,
pub __extctx_magic: ::c_int,
pub __pad: [::c_int; 1],
}
pub struct mcontext_t {
pub gpr: [::c_ulonglong; 32],
pub msr: ::c_ulonglong,
pub iar: ::c_ulonglong,
pub lr: ::c_ulonglong,
pub ctr: ::c_ulonglong,
pub cr: ::c_uint,
pub xer: ::c_uint,
pub fpscr: ::c_uint,
pub fpscrx: ::c_uint,
pub except: [::c_ulonglong; 1],
// Should be array of double type
pub fpr: [::uint64_t; 32],
pub fpeu: ::c_char,
pub fpinfo: ::c_char,
pub fpscr24_31: ::c_char,
pub pad: [::c_char; 1],
pub excp_type: ::c_int,
}
pub struct utmpx {
pub ut_user: [::c_char; 256],
pub ut_id: [::c_char; 14],
pub ut_line: [::c_char; 64],
pub ut_pid: ::pid_t,
pub ut_type: ::c_short,
pub ut_tv: ::timeval,
pub ut_host: [::c_char; 256],
pub __dbl_word_pad: ::c_int,
pub __reservedA: [::c_int; 2],
pub __reservedV: [::c_int; 6],
}
pub struct pthread_spinlock_t {
pub __sp_word: [::c_long; 3],
}
pub struct pthread_barrier_t {
pub __br_word: [::c_long; 5],
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
pub msg_first: ::c_uint,
pub msg_last: ::c_uint,
pub msg_cbytes: ::c_uint,
pub msg_qnum: ::c_uint,
pub msg_qbytes: ::c_ulong,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
pub msg_rwait: ::c_int,
pub msg_wwait: ::c_int,
pub msg_reqevents: ::c_ushort,
}
}
s_no_extra_traits! {
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub si_pid: ::pid_t,
pub si_uid: ::uid_t,
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_band: ::c_long,
pub si_value: ::sigval,
pub __si_flags: ::c_int,
pub __pad: [::c_int; 3],
}
#[cfg(libc_union)]
pub union _kernel_simple_lock {
pub _slock: ::c_long,
// Should be pointer to 'lock_data_instrumented'
pub _slockp: *mut ::c_void,
}
pub struct fileops_t {
pub fo_rw: extern fn(file: *mut file, rw: ::uio_rw, io: *mut ::c_void, ext: ::c_long,
secattr: *mut ::c_void) -> ::c_int,
pub fo_ioctl: extern fn(file: *mut file, a: ::c_long, b: ::caddr_t, c: ::c_long,
d: ::c_long) -> ::c_int,
pub fo_select: extern fn(file: *mut file, a: ::c_int, b: *mut ::c_ushort,
c: extern fn()) -> ::c_int,
pub fo_close: extern fn(file: *mut file) -> ::c_int,
pub fo_fstat: extern fn(file: *mut file, sstat: *mut ::stat) -> ::c_int,
}
pub struct file {
pub f_flag: ::c_long,
pub f_count: ::c_int,
pub f_options: ::c_short,
pub f_type: ::c_short,
// Should be pointer to 'vnode'
pub f_data: *mut ::c_void,
pub f_offset: ::c_longlong,
pub f_dir_off: ::c_long,
// Should be pointer to 'cred'
pub f_cred: *mut ::c_void,
#[cfg(libc_union)]
pub f_lock: _kernel_simple_lock,
#[cfg(libc_union)]
pub f_offset_lock: _kernel_simple_lock,
pub f_vinfo: ::caddr_t,
pub f_ops: *mut fileops_t,
pub f_parentp: ::caddr_t,
pub f_fnamep: ::caddr_t,
pub f_fdata: [::c_char; 160],
}
#[cfg(libc_union)]
pub union __ld_info_file {
pub _ldinfo_fd: ::c_int,
pub _ldinfo_fp: *mut file,
pub _core_offset: ::c_long,
}
pub struct ld_info {
pub ldinfo_next: ::c_uint,
pub ldinfo_flags: ::c_uint,
#[cfg(libc_union)]
pub _file: __ld_info_file,
pub ldinfo_textorg: *mut ::c_void,
pub ldinfo_textsize: ::c_ulong,
pub ldinfo_dataorg: *mut ::c_void,
pub ldinfo_datasize: ::c_ulong,
pub ldinfo_filename: [::c_char; 2],
}
#[cfg(libc_union)]
pub union __pollfd_ext_u {
pub addr: *mut ::c_void,
pub data32: u32,
pub data: u64,
}
pub struct pollfd_ext {
pub fd: ::c_int,
pub events: ::c_ushort,
pub revents: ::c_ushort,
#[cfg(libc_union)]
pub data: __pollfd_ext_u,
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}
pub unsafe fn si_pid(&self) -> ::pid_t {
self.si_pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
self.si_uid
}
pub unsafe fn si_status(&self) -> ::c_int {
self.si_status
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for siginfo_t {
fn eq(&self, other: &siginfo_t) -> bool {
#[cfg(libc_union)]
let value_eq = self.si_value == other.si_value;
#[cfg(not(libc_union))]
let value_eq = true;
self.si_signo == other.si_signo
&& self.si_errno == other.si_errno
&& self.si_code == other.si_code
&& self.si_pid == other.si_pid
&& self.si_uid == other.si_uid
&& self.si_status == other.si_status
&& self.si_addr == other.si_addr
&& self.si_band == other.si_band
&& self.__si_flags == other.__si_flags
&& value_eq
}
}
impl Eq for siginfo_t {}
impl ::fmt::Debug for siginfo_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("siginfo_t");
struct_formatter.field("si_signo", &self.si_signo);
struct_formatter.field("si_errno", &self.si_errno);
struct_formatter.field("si_code", &self.si_code);
struct_formatter.field("si_pid", &self.si_pid);
struct_formatter.field("si_uid", &self.si_uid);
struct_formatter.field("si_status", &self.si_status);
struct_formatter.field("si_addr", &self.si_addr);
struct_formatter.field("si_band", &self.si_band);
#[cfg(libc_union)]
struct_formatter.field("si_value", &self.si_value);
struct_formatter.field("__si_flags", &self.__si_flags);
struct_formatter.finish()
}
}
impl ::hash::Hash for siginfo_t {
fn hash(&self, state: &mut H) {
self.si_signo.hash(state);
self.si_errno.hash(state);
self.si_code.hash(state);
self.si_pid.hash(state);
self.si_uid.hash(state);
self.si_status.hash(state);
self.si_addr.hash(state);
self.si_band.hash(state);
#[cfg(libc_union)]
self.si_value.hash(state);
self.__si_flags.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for _kernel_simple_lock {
fn eq(&self, other: &_kernel_simple_lock) -> bool {
unsafe {
self._slock == other._slock
&& self._slockp == other._slockp
}
}
}
#[cfg(libc_union)]
impl Eq for _kernel_simple_lock {}
#[cfg(libc_union)]
impl ::fmt::Debug for _kernel_simple_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("_kernel_simple_lock")
.field("_slock", unsafe { &self._slock })
.field("_slockp", unsafe { &self._slockp })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for _kernel_simple_lock {
fn hash(&self, state: &mut H) {
unsafe {
self._slock.hash(state);
self._slockp.hash(state);
}
}
}
impl PartialEq for fileops_t {
fn eq(&self, other: &fileops_t) -> bool {
self.fo_rw == other.fo_rw
&& self.fo_ioctl == other.fo_ioctl
&& self.fo_select == other.fo_select
&& self.fo_close == other.fo_close
&& self.fo_fstat == other.fo_fstat
}
}
impl Eq for fileops_t {}
impl ::fmt::Debug for fileops_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("fileops_t");
struct_formatter.field("fo_rw", &self.fo_rw);
struct_formatter.field("fo_ioctl", &self.fo_ioctl);
struct_formatter.field("fo_select", &self.fo_select);
struct_formatter.field("fo_close", &self.fo_close);
struct_formatter.field("fo_fstat", &self.fo_fstat);
struct_formatter.finish()
}
}
impl ::hash::Hash for fileops_t {
fn hash(&self, state: &mut H) {
self.fo_rw.hash(state);
self.fo_ioctl.hash(state);
self.fo_select.hash(state);
self.fo_close.hash(state);
self.fo_fstat.hash(state);
}
}
impl PartialEq for file {
fn eq(&self, other: &file) -> bool {
#[cfg(libc_union)]
let lock_eq = self.f_lock == other.f_lock
&& self.f_offset_lock == other.f_offset_lock;
#[cfg(not(libc_union))]
let lock_eq = true;
self.f_flag == other.f_flag
&& self.f_count == other.f_count
&& self.f_options == other.f_options
&& self.f_type == other.f_type
&& self.f_data == other.f_data
&& self.f_offset == other.f_offset
&& self.f_dir_off == other.f_dir_off
&& self.f_cred == other.f_cred
&& self.f_vinfo == other.f_vinfo
&& self.f_ops == other.f_ops
&& self.f_parentp == other.f_parentp
&& self.f_fnamep == other.f_fnamep
&& self.f_fdata == other.f_fdata
&& lock_eq
}
}
impl Eq for file {}
impl ::fmt::Debug for file {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("file");
struct_formatter.field("f_flag", &self.f_flag);
struct_formatter.field("f_count", &self.f_count);
struct_formatter.field("f_options", &self.f_options);
struct_formatter.field("f_type", &self.f_type);
struct_formatter.field("f_data", &self.f_data);
struct_formatter.field("f_offset", &self.f_offset);
struct_formatter.field("f_dir_off", &self.f_dir_off);
struct_formatter.field("f_cred", &self.f_cred);
#[cfg(libc_union)]
struct_formatter.field("f_lock", &self.f_lock);
#[cfg(libc_union)]
struct_formatter.field("f_offset_lock", &self.f_offset_lock);
struct_formatter.field("f_vinfo", &self.f_vinfo);
struct_formatter.field("f_ops", &self.f_ops);
struct_formatter.field("f_parentp", &self.f_parentp);
struct_formatter.field("f_fnamep", &self.f_fnamep);
struct_formatter.field("f_fdata", &self.f_fdata);
struct_formatter.finish()
}
}
impl ::hash::Hash for file {
fn hash(&self, state: &mut H) {
self.f_flag.hash(state);
self.f_count.hash(state);
self.f_options.hash(state);
self.f_type.hash(state);
self.f_data.hash(state);
self.f_offset.hash(state);
self.f_dir_off.hash(state);
self.f_cred.hash(state);
#[cfg(libc_union)]
self.f_lock.hash(state);
#[cfg(libc_union)]
self.f_offset_lock.hash(state);
self.f_vinfo.hash(state);
self.f_ops.hash(state);
self.f_parentp.hash(state);
self.f_fnamep.hash(state);
self.f_fdata.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __ld_info_file {
fn eq(&self, other: &__ld_info_file) -> bool {
unsafe {
self._ldinfo_fd == other._ldinfo_fd
&& self._ldinfo_fp == other._ldinfo_fp
&& self._core_offset == other._core_offset
}
}
}
#[cfg(libc_union)]
impl Eq for __ld_info_file {}
#[cfg(libc_union)]
impl ::fmt::Debug for __ld_info_file {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__ld_info_file")
.field("_ldinfo_fd", unsafe { &self._ldinfo_fd })
.field("_ldinfo_fp", unsafe { &self._ldinfo_fp })
.field("_core_offset", unsafe { &self._core_offset })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __ld_info_file {
fn hash(&self, state: &mut H) {
unsafe {
self._ldinfo_fd.hash(state);
self._ldinfo_fp.hash(state);
self._core_offset.hash(state);
}
}
}
impl PartialEq for ld_info {
fn eq(&self, other: &ld_info) -> bool {
#[cfg(libc_union)]
let file_eq = self._file == other._file;
#[cfg(not(libc_union))]
let file_eq = true;
self.ldinfo_next == other.ldinfo_next
&& self.ldinfo_flags == other.ldinfo_flags
&& self.ldinfo_textorg == other.ldinfo_textorg
&& self.ldinfo_textsize == other.ldinfo_textsize
&& self.ldinfo_dataorg == other.ldinfo_dataorg
&& self.ldinfo_datasize == other.ldinfo_datasize
&& self.ldinfo_filename == other.ldinfo_filename
&& file_eq
}
}
impl Eq for ld_info {}
impl ::fmt::Debug for ld_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("ld_info");
struct_formatter.field("ldinfo_next", &self.ldinfo_next);
struct_formatter.field("ldinfo_flags", &self.ldinfo_flags);
struct_formatter.field("ldinfo_textorg", &self.ldinfo_textorg);
struct_formatter.field("ldinfo_textsize", &self.ldinfo_textsize);
struct_formatter.field("ldinfo_dataorg", &self.ldinfo_dataorg);
struct_formatter.field("ldinfo_datasize", &self.ldinfo_datasize);
struct_formatter.field("ldinfo_filename", &self.ldinfo_filename);
#[cfg(libc_union)]
struct_formatter.field("_file", &self._file);
struct_formatter.finish()
}
}
impl ::hash::Hash for ld_info {
fn hash(&self, state: &mut H) {
self.ldinfo_next.hash(state);
self.ldinfo_flags.hash(state);
self.ldinfo_textorg.hash(state);
self.ldinfo_textsize.hash(state);
self.ldinfo_dataorg.hash(state);
self.ldinfo_datasize.hash(state);
self.ldinfo_filename.hash(state);
#[cfg(libc_union)]
self._file.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __pollfd_ext_u {
fn eq(&self, other: &__pollfd_ext_u) -> bool {
unsafe {
self.addr == other.addr
&& self.data32 == other.data32
&& self.data == other.data
}
}
}
#[cfg(libc_union)]
impl Eq for __pollfd_ext_u {}
#[cfg(libc_union)]
impl ::fmt::Debug for __pollfd_ext_u {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__pollfd_ext_u")
.field("addr", unsafe { &self.addr })
.field("data32", unsafe { &self.data32 })
.field("data", unsafe { &self.data })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __pollfd_ext_u {
fn hash(&self, state: &mut H) {
unsafe {
self.addr.hash(state);
self.data.hash(state);
self.data32.hash(state);
}
}
}
impl PartialEq for pollfd_ext {
fn eq(&self, other: &pollfd_ext) -> bool {
#[cfg(libc_union)]
let data_eq = self.data == other.data;
#[cfg(not(libc_union))]
let data_eq = true;
self.fd == other.fd
&& self.events == other.events
&& self.revents == other.revents
&& data_eq
}
}
impl Eq for pollfd_ext {}
impl ::fmt::Debug for pollfd_ext {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("pollfd_ext");
struct_formatter.field("fd", &self.fd);
struct_formatter.field("events", &self.events);
struct_formatter.field("revents", &self.revents);
#[cfg(libc_union)]
struct_formatter.field("data", &self.data);
struct_formatter.finish()
}
}
impl ::hash::Hash for pollfd_ext {
fn hash(&self, state: &mut H) {
self.fd.hash(state);
self.events.hash(state);
self.revents.hash(state);
#[cfg(libc_union)]
self.data.hash(state);
}
}
}
}
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__mt_word: [0, 2, 0, 0, 0, 0, 0, 0],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
__cv_word: [0, 0, 0, 0, 2, 0],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
__rw_word: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0],
};
pub const RLIM_INFINITY: ::c_ulong = 0x7fffffffffffffff;
extern "C" {
pub fn getsystemcfg(label: ::c_int) -> ::c_ulong;
}
libc-0.2.152/src/unix/align.rs 0000644 0000000 0000000 00000000134 10461020230 0014114 0 ustar 0000000 0000000 s! {
#[repr(align(4))]
pub struct in6_addr {
pub s6_addr: [u8; 16],
}
}
libc-0.2.152/src/unix/bsd/apple/b32/align.rs 0000644 0000000 0000000 00000000225 10461020230 0016354 0 ustar 0000000 0000000 s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}
libc-0.2.152/src/unix/bsd/apple/b32/mod.rs 0000644 0000000 0000000 00000006377 10461020230 0016057 0 ustar 0000000 0000000 //! 32-bit specific Apple (ios/darwin) definitions
pub type c_long = i32;
pub type c_ulong = u32;
pub type boolean_t = ::c_int;
s! {
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: ::timeval,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: keeping private for now
}
}
s_no_extra_traits! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 36]
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_attr_t {
fn eq(&self, other: &pthread_attr_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_attr_t {}
impl ::fmt::Debug for pthread_attr_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_attr_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_attr_t {
fn hash(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
}
}
#[doc(hidden)]
#[deprecated(since = "0.2.55")]
pub const NET_RT_MAXID: ::c_int = 10;
pub const __PTHREAD_MUTEX_SIZE__: usize = 40;
pub const __PTHREAD_COND_SIZE__: usize = 24;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 4;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 124;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40087458;
pub const BIOCSETF: ::c_ulong = 0x80084267;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
pub const BIOCSETFNR: ::c_ulong = 0x8008427e;
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
path2: *const ::c_char,
options: ::c_ulong,
) -> ::c_int;
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}
libc-0.2.152/src/unix/bsd/apple/b64/aarch64/align.rs 0000644 0000000 0000000 00000002706 10461020230 0017617 0 ustar 0000000 0000000 pub type mcontext_t = *mut __darwin_mcontext64;
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
pub struct max_align_t {
priv_: f64
}
}
s! {
pub struct ucontext_t {
pub uc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
}
pub struct __darwin_mcontext64 {
pub __es: __darwin_arm_exception_state64,
pub __ss: __darwin_arm_thread_state64,
pub __ns: __darwin_arm_neon_state64,
}
pub struct __darwin_arm_exception_state64 {
pub __far: u64,
pub __esr: u32,
pub __exception: u32,
}
pub struct __darwin_arm_thread_state64 {
pub __x: [u64; 29],
pub __fp: u64,
pub __lr: u64,
pub __sp: u64,
pub __pc: u64,
pub __cpsr: u32,
pub __pad: u32,
}
// This type natively uses a uint128, but for a while we hacked
// it in with repr(align) and `[u64; 2]`. uint128 isn't available
// all the way back to our earliest supported versions so we
// preserver the old shim.
#[cfg_attr(not(libc_int128), repr(align(16)))]
pub struct __darwin_arm_neon_state64 {
#[cfg(libc_int128)]
pub __v: [::__uint128_t; 32],
#[cfg(not(libc_int128))]
pub __v: [[u64; 2]; 32],
pub __fpsr: u32,
pub __fpcr: u32,
}
}
libc-0.2.152/src/unix/bsd/apple/b64/aarch64/mod.rs 0000644 0000000 0000000 00000000377 10461020230 0017306 0 ustar 0000000 0000000 pub type boolean_t = ::c_int;
s! {
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
}
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}
libc-0.2.152/src/unix/bsd/apple/b64/align.rs 0000644 0000000 0000000 00000000225 10461020230 0016361 0 ustar 0000000 0000000 s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}
libc-0.2.152/src/unix/bsd/apple/b64/mod.rs 0000644 0000000 0000000 00000006552 10461020230 0016057 0 ustar 0000000 0000000 //! 64-bit specific Apple (ios/darwin) definitions
pub type c_long = i64;
pub type c_ulong = u64;
s! {
pub struct timeval32 {
pub tv_sec: i32,
pub tv_usec: i32,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u32,
pub ifi_ipackets: u32,
pub ifi_ierrors: u32,
pub ifi_opackets: u32,
pub ifi_oerrors: u32,
pub ifi_collisions: u32,
pub ifi_ibytes: u32,
pub ifi_obytes: u32,
pub ifi_imcasts: u32,
pub ifi_omcasts: u32,
pub ifi_iqdrops: u32,
pub ifi_noproto: u32,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
pub ifi_lastchange: timeval32,
pub ifi_unused2: u32,
pub ifi_hwassist: u32,
pub ifi_reserved1: u32,
pub ifi_reserved2: u32,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval32,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
}
s_no_extra_traits! {
pub struct pthread_attr_t {
__sig: c_long,
__opaque: [::c_char; 56]
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for pthread_attr_t {
fn eq(&self, other: &pthread_attr_t) -> bool {
self.__sig == other.__sig
&& self.__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_attr_t {}
impl ::fmt::Debug for pthread_attr_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_attr_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_attr_t {
fn hash(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
}
}
#[doc(hidden)]
#[deprecated(since = "0.2.55")]
pub const NET_RT_MAXID: ::c_int = 11;
pub const __PTHREAD_MUTEX_SIZE__: usize = 56;
pub const __PTHREAD_COND_SIZE__: usize = 40;
pub const __PTHREAD_CONDATTR_SIZE__: usize = 8;
pub const __PTHREAD_RWLOCK_SIZE__: usize = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
pub const BIOCSETF: ::c_ulong = 0x80104267;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const BIOCSETFNR: ::c_ulong = 0x8010427e;
extern "C" {
pub fn exchangedata(
path1: *const ::c_char,
path2: *const ::c_char,
options: ::c_uint,
) -> ::c_int;
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else {
// Unknown target_arch
}
}
libc-0.2.152/src/unix/bsd/apple/b64/x86_64/align.rs 0000644 0000000 0000000 00000000225 10461020230 0017317 0 ustar 0000000 0000000 s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 2]
}
}
libc-0.2.152/src/unix/bsd/apple/b64/x86_64/mod.rs 0000644 0000000 0000000 00000013125 10461020230 0017007 0 ustar 0000000 0000000 pub type boolean_t = ::c_uint;
pub type mcontext_t = *mut __darwin_mcontext64;
s! {
pub struct ucontext_t {
pub uc_onstack: ::c_int,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_link: *mut ::ucontext_t,
pub uc_mcsize: usize,
pub uc_mcontext: mcontext_t,
}
pub struct __darwin_mcontext64 {
pub __es: __darwin_x86_exception_state64,
pub __ss: __darwin_x86_thread_state64,
pub __fs: __darwin_x86_float_state64,
}
pub struct __darwin_x86_exception_state64 {
pub __trapno: u16,
pub __cpu: u16,
pub __err: u32,
pub __faultvaddr: u64,
}
pub struct __darwin_x86_thread_state64 {
pub __rax: u64,
pub __rbx: u64,
pub __rcx: u64,
pub __rdx: u64,
pub __rdi: u64,
pub __rsi: u64,
pub __rbp: u64,
pub __rsp: u64,
pub __r8: u64,
pub __r9: u64,
pub __r10: u64,
pub __r11: u64,
pub __r12: u64,
pub __r13: u64,
pub __r14: u64,
pub __r15: u64,
pub __rip: u64,
pub __rflags: u64,
pub __cs: u64,
pub __fs: u64,
pub __gs: u64,
}
pub struct __darwin_x86_float_state64 {
pub __fpu_reserved: [::c_int; 2],
__fpu_fcw: ::c_short,
__fpu_fsw: ::c_short,
pub __fpu_ftw: u8,
pub __fpu_rsrv1: u8,
pub __fpu_fop: u16,
pub __fpu_ip: u32,
pub __fpu_cs: u16,
pub __fpu_rsrv2: u16,
pub __fpu_dp: u32,
pub __fpu_ds: u16,
pub __fpu_rsrv3: u16,
pub __fpu_mxcsr: u32,
pub __fpu_mxcsrmask: u32,
pub __fpu_stmm0: __darwin_mmst_reg,
pub __fpu_stmm1: __darwin_mmst_reg,
pub __fpu_stmm2: __darwin_mmst_reg,
pub __fpu_stmm3: __darwin_mmst_reg,
pub __fpu_stmm4: __darwin_mmst_reg,
pub __fpu_stmm5: __darwin_mmst_reg,
pub __fpu_stmm6: __darwin_mmst_reg,
pub __fpu_stmm7: __darwin_mmst_reg,
pub __fpu_xmm0: __darwin_xmm_reg,
pub __fpu_xmm1: __darwin_xmm_reg,
pub __fpu_xmm2: __darwin_xmm_reg,
pub __fpu_xmm3: __darwin_xmm_reg,
pub __fpu_xmm4: __darwin_xmm_reg,
pub __fpu_xmm5: __darwin_xmm_reg,
pub __fpu_xmm6: __darwin_xmm_reg,
pub __fpu_xmm7: __darwin_xmm_reg,
pub __fpu_xmm8: __darwin_xmm_reg,
pub __fpu_xmm9: __darwin_xmm_reg,
pub __fpu_xmm10: __darwin_xmm_reg,
pub __fpu_xmm11: __darwin_xmm_reg,
pub __fpu_xmm12: __darwin_xmm_reg,
pub __fpu_xmm13: __darwin_xmm_reg,
pub __fpu_xmm14: __darwin_xmm_reg,
pub __fpu_xmm15: __darwin_xmm_reg,
// this field is actually [u8; 96], but defining it with a bigger type
// allows us to auto-implement traits for it since the length of the
// array is less than 32
__fpu_rsrv4: [u32; 24],
pub __fpu_reserved1: ::c_int,
}
pub struct __darwin_mmst_reg {
pub __mmst_reg: [::c_char; 10],
pub __mmst_rsrv: [::c_char; 6],
}
pub struct __darwin_xmm_reg {
pub __xmm_reg: [::c_char; 16],
}
pub struct malloc_introspection_t {
_private: [::uintptr_t; 16], // FIXME: keeping private for now
}
pub struct malloc_zone_t {
_reserved1: *mut ::c_void,
_reserved2: *mut ::c_void,
pub size: ::Option ::size_t>,
pub malloc: ::Option *mut ::c_void>,
pub calloc: ::Option *mut ::c_void>,
pub valloc: ::Option *mut ::c_void>,
pub free: ::Option,
pub realloc: ::Option *mut ::c_void>,
pub destroy: ::Option,
pub zone_name: *const ::c_char,
pub batch_malloc: ::Option ::c_uint>,
pub batch_free: ::Option,
pub introspect: *mut malloc_introspection_t,
pub version: ::c_uint,
pub memalign: ::Option *mut ::c_void>,
pub free_definite_size: ::Option,
pub pressure_relief: ::Option ::size_t>,
pub claimed_address: ::Option ::boolean_t>,
}
}
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}
libc-0.2.152/src/unix/bsd/apple/long_array.rs 0000644 0000000 0000000 00000000227 10461020230 0017033 0 ustar 0000000 0000000 s! {
pub struct ctl_info {
pub ctl_id: u32,
pub ctl_name: [::c_char; MAX_KCTL_NAME],
}
}
pub const MAX_KCTL_NAME: usize = 96;
libc-0.2.152/src/unix/bsd/apple/mod.rs 0000644 0000000 0000000 00000727345 10461020230 0015476 0 ustar 0000000 0000000 //! Apple (ios/darwin)-specific definitions
//!
//! This covers *-apple-* triples currently
pub type c_char = i8;
pub type wchar_t = i32;
pub type clock_t = c_ulong;
pub type time_t = c_long;
pub type suseconds_t = i32;
pub type dev_t = i32;
pub type ino_t = u64;
pub type mode_t = u16;
pub type nlink_t = u16;
pub type blksize_t = i32;
pub type rlim_t = u64;
pub type pthread_key_t = c_ulong;
pub type sigset_t = u32;
pub type clockid_t = ::c_uint;
pub type fsblkcnt_t = ::c_uint;
pub type fsfilcnt_t = ::c_uint;
pub type speed_t = ::c_ulong;
pub type tcflag_t = ::c_ulong;
pub type nl_item = ::c_int;
pub type id_t = ::c_uint;
pub type sem_t = ::c_int;
pub type idtype_t = ::c_uint;
pub type integer_t = ::c_int;
pub type cpu_type_t = integer_t;
pub type cpu_subtype_t = integer_t;
pub type natural_t = u32;
pub type mach_msg_type_number_t = natural_t;
pub type kern_return_t = ::c_int;
pub type uuid_t = [u8; 16];
pub type task_info_t = *mut integer_t;
pub type host_info_t = *mut integer_t;
pub type task_flavor_t = natural_t;
pub type rusage_info_t = *mut ::c_void;
pub type vm_offset_t = ::uintptr_t;
pub type vm_size_t = ::uintptr_t;
pub type vm_address_t = vm_offset_t;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
pub type key_t = ::c_int;
pub type shmatt_t = ::c_ushort;
pub type sae_associd_t = u32;
pub type sae_connid_t = u32;
pub type mach_port_t = ::c_uint;
pub type host_t = ::c_uint;
pub type host_flavor_t = integer_t;
pub type host_info64_t = *mut integer_t;
pub type processor_flavor_t = ::c_int;
pub type thread_flavor_t = natural_t;
pub type thread_inspect_t = ::mach_port_t;
pub type thread_act_t = ::mach_port_t;
pub type thread_act_array_t = *mut ::thread_act_t;
pub type policy_t = ::c_int;
pub type mach_vm_address_t = u64;
pub type mach_vm_offset_t = u64;
pub type mach_vm_size_t = u64;
pub type vm_map_t = ::mach_port_t;
pub type mem_entry_name_port_t = ::mach_port_t;
pub type memory_object_t = ::mach_port_t;
pub type memory_object_offset_t = ::c_ulonglong;
pub type vm_inherit_t = ::c_uint;
pub type vm_prot_t = ::c_int;
pub type ledger_t = ::mach_port_t;
pub type ledger_array_t = *mut ::ledger_t;
pub type iconv_t = *mut ::c_void;
pub type processor_cpu_load_info_t = *mut processor_cpu_load_info;
pub type processor_cpu_load_info_data_t = processor_cpu_load_info;
pub type processor_basic_info_t = *mut processor_basic_info;
pub type processor_basic_info_data_t = processor_basic_info;
pub type processor_set_basic_info_data_t = processor_set_basic_info;
pub type processor_set_basic_info_t = *mut processor_set_basic_info;
pub type processor_set_load_info_data_t = processor_set_load_info;
pub type processor_set_load_info_t = *mut processor_set_load_info;
pub type processor_info_t = *mut integer_t;
pub type processor_info_array_t = *mut integer_t;
pub type mach_task_basic_info_data_t = mach_task_basic_info;
pub type mach_task_basic_info_t = *mut mach_task_basic_info;
pub type task_thread_times_info_data_t = task_thread_times_info;
pub type task_thread_times_info_t = *mut task_thread_times_info;
pub type thread_info_t = *mut integer_t;
pub type thread_basic_info_t = *mut thread_basic_info;
pub type thread_basic_info_data_t = thread_basic_info;
pub type thread_identifier_info_t = *mut thread_identifier_info;
pub type thread_identifier_info_data_t = thread_identifier_info;
pub type thread_extended_info_t = *mut thread_extended_info;
pub type thread_extended_info_data_t = thread_extended_info;
pub type thread_t = ::mach_port_t;
pub type thread_policy_flavor_t = natural_t;
pub type thread_policy_t = *mut integer_t;
pub type thread_latency_qos_t = integer_t;
pub type thread_throughput_qos_t = integer_t;
pub type thread_standard_policy_data_t = thread_standard_policy;
pub type thread_standard_policy_t = *mut thread_standard_policy;
pub type thread_extended_policy_data_t = thread_extended_policy;
pub type thread_extended_policy_t = *mut thread_extended_policy;
pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy;
pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy;
pub type thread_precedence_policy_data_t = thread_precedence_policy;
pub type thread_precedence_policy_t = *mut thread_precedence_policy;
pub type thread_affinity_policy_data_t = thread_affinity_policy;
pub type thread_affinity_policy_t = *mut thread_affinity_policy;
pub type thread_background_policy_data_t = thread_background_policy;
pub type thread_background_policy_t = *mut thread_background_policy;
pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy;
pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy;
pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy;
pub type pthread_introspection_hook_t =
extern "C" fn(event: ::c_uint, thread: ::pthread_t, addr: *mut ::c_void, size: ::size_t);
pub type pthread_jit_write_callback_t = ::Option ::c_int>;
pub type os_unfair_lock = os_unfair_lock_s;
pub type os_unfair_lock_t = *mut os_unfair_lock;
pub type os_log_t = *mut ::c_void;
pub type os_log_type_t = u8;
pub type os_signpost_id_t = u64;
pub type os_signpost_type_t = u8;
pub type vm_statistics_t = *mut vm_statistics;
pub type vm_statistics_data_t = vm_statistics;
pub type vm_statistics64_t = *mut vm_statistics64;
pub type vm_statistics64_data_t = vm_statistics64;
pub type task_t = ::mach_port_t;
pub type task_inspect_t = ::mach_port_t;
pub type sysdir_search_path_enumeration_state = ::c_uint;
pub type CCStatus = i32;
pub type CCCryptorStatus = i32;
pub type CCRNGStatus = ::CCCryptorStatus;
pub type copyfile_state_t = *mut ::c_void;
pub type copyfile_flags_t = u32;
pub type copyfile_callback_t = ::Option<
extern "C" fn(
::c_int,
::c_int,
copyfile_state_t,
*const ::c_char,
*const ::c_char,
*mut ::c_void,
) -> ::c_int,
>;
pub type attrgroup_t = u32;
pub type vol_capabilities_set_t = [u32; 4];
deprecated_mach! {
pub type mach_timebase_info_data_t = mach_timebase_info;
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
impl ::Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
#[repr(u32)]
pub enum qos_class_t {
QOS_CLASS_USER_INTERACTIVE = 0x21,
QOS_CLASS_USER_INITIATED = 0x19,
QOS_CLASS_DEFAULT = 0x15,
QOS_CLASS_UTILITY = 0x11,
QOS_CLASS_BACKGROUND = 0x09,
QOS_CLASS_UNSPECIFIED = 0x00,
}
impl ::Copy for qos_class_t {}
impl ::Clone for qos_class_t {
fn clone(&self) -> qos_class_t {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
#[repr(u32)]
pub enum sysdir_search_path_directory_t {
SYSDIR_DIRECTORY_APPLICATION = 1,
SYSDIR_DIRECTORY_DEMO_APPLICATION = 2,
SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3,
SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4,
SYSDIR_DIRECTORY_LIBRARY = 5,
SYSDIR_DIRECTORY_DEVELOPER = 6,
SYSDIR_DIRECTORY_USER = 7,
SYSDIR_DIRECTORY_DOCUMENTATION = 8,
SYSDIR_DIRECTORY_DOCUMENT = 9,
SYSDIR_DIRECTORY_CORESERVICE = 10,
SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11,
SYSDIR_DIRECTORY_DESKTOP = 12,
SYSDIR_DIRECTORY_CACHES = 13,
SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14,
SYSDIR_DIRECTORY_DOWNLOADS = 15,
SYSDIR_DIRECTORY_INPUT_METHODS = 16,
SYSDIR_DIRECTORY_MOVIES = 17,
SYSDIR_DIRECTORY_MUSIC = 18,
SYSDIR_DIRECTORY_PICTURES = 19,
SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20,
SYSDIR_DIRECTORY_SHARED_PUBLIC = 21,
SYSDIR_DIRECTORY_PREFERENCE_PANES = 22,
SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100,
SYSDIR_DIRECTORY_ALL_LIBRARIES = 101,
}
impl ::Copy for sysdir_search_path_directory_t {}
impl ::Clone for sysdir_search_path_directory_t {
fn clone(&self) -> sysdir_search_path_directory_t {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
#[repr(u32)]
pub enum sysdir_search_path_domain_mask_t {
SYSDIR_DOMAIN_MASK_USER = (1 << 0),
SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1),
SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2),
SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3),
SYSDIR_DOMAIN_MASK_ALL = 0x0ffff,
}
impl ::Copy for sysdir_search_path_domain_mask_t {}
impl ::Clone for sysdir_search_path_domain_mask_t {
fn clone(&self) -> sysdir_search_path_domain_mask_t {
*self
}
}
s! {
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: ::c_int,
}
pub struct ip_mreq_source {
pub imr_multiaddr: in_addr,
pub imr_sourceaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
pub aio_reqprio: ::c_int,
pub aio_sigevent: sigevent,
pub aio_lio_opcode: ::c_int
}
pub struct glob_t {
pub gl_pathc: ::size_t,
__unused1: ::c_int,
pub gl_offs: ::size_t,
__unused2: ::c_int,
pub gl_pathv: *mut *mut ::c_char,
__unused3: *mut ::c_void,
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
__unused6: *mut ::c_void,
__unused7: *mut ::c_void,
__unused8: *mut ::c_void,
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::socklen_t,
pub ai_canonname: *mut ::c_char,
pub ai_addr: *mut ::sockaddr,
pub ai_next: *mut addrinfo,
}
#[deprecated(
since = "0.2.55",
note = "Use the `mach2` crate instead",
)]
pub struct mach_timebase_info {
pub numer: u32,
pub denom: u32,
}
pub struct stat {
pub st_dev: dev_t,
pub st_mode: mode_t,
pub st_nlink: nlink_t,
pub st_ino: ino_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: dev_t,
pub st_atime: time_t,
pub st_atime_nsec: c_long,
pub st_mtime: time_t,
pub st_mtime_nsec: c_long,
pub st_ctime: time_t,
pub st_ctime_nsec: c_long,
pub st_birthtime: time_t,
pub st_birthtime_nsec: c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: blksize_t,
pub st_flags: u32,
pub st_gen: u32,
pub st_lspare: i32,
pub st_qspare: [i64; 2],
}
pub struct pthread_mutexattr_t {
__sig: ::c_long,
__opaque: [u8; 8],
}
pub struct pthread_condattr_t {
__sig: ::c_long,
__opaque: [u8; __PTHREAD_CONDATTR_SIZE__],
}
pub struct pthread_rwlockattr_t {
__sig: ::c_long,
__opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__],
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub si_pid: ::pid_t,
pub si_uid: ::uid_t,
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
//Requires it to be union for tests
//pub si_value: ::sigval,
_pad: [usize; 9],
}
pub struct sigaction {
// FIXME: this field is actually a union
pub sa_sigaction: ::sighandler_t,
pub sa_mask: sigset_t,
pub sa_flags: ::c_int,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct fstore_t {
pub fst_flags: ::c_uint,
pub fst_posmode: ::c_int,
pub fst_offset: ::off_t,
pub fst_length: ::off_t,
pub fst_bytesalloc: ::off_t,
}
pub struct fpunchhole_t {
pub fp_flags: ::c_uint, /* unused */
pub reserved: ::c_uint, /* (to maintain 8-byte alignment) */
pub fp_offset: ::off_t, /* IN: start of the region */
pub fp_length: ::off_t, /* IN: size of the region */
}
pub struct ftrimactivefile_t {
pub fta_offset: ::off_t,
pub fta_length: ::off_t,
}
pub struct fspecread_t {
pub fsr_flags: ::c_uint,
pub reserved: ::c_uint,
pub fsr_offset: ::off_t,
pub fsr_length: ::off_t,
}
pub struct radvisory {
pub ra_offset: ::off_t,
pub ra_count: ::c_int,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *mut ::c_void,
}
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: ::sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [::c_char; 8],
}
pub struct kevent64_s {
pub ident: u64,
pub filter: i16,
pub flags: u16,
pub fflags: u32,
pub data: i64,
pub udata: u64,
pub ext: [u64; 2],
}
pub struct dqblk {
pub dqb_bhardlimit: u64,
pub dqb_bsoftlimit: u64,
pub dqb_curbytes: u64,
pub dqb_ihardlimit: u32,
pub dqb_isoftlimit: u32,
pub dqb_curinodes: u32,
pub dqb_btime: u32,
pub dqb_itime: u32,
pub dqb_id: u32,
pub dqb_spare: [u32; 4],
}
pub struct if_msghdr {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
pub struct ifa_msghdr {
pub ifam_msglen: ::c_ushort,
pub ifam_version: ::c_uchar,
pub ifam_type: ::c_uchar,
pub ifam_addrs: ::c_int,
pub ifam_flags: ::c_int,
pub ifam_index: ::c_ushort,
pub ifam_metric: ::c_int,
}
pub struct ifma_msghdr {
pub ifmam_msglen: ::c_ushort,
pub ifmam_version: ::c_uchar,
pub ifmam_type: ::c_uchar,
pub ifmam_addrs: ::c_int,
pub ifmam_flags: ::c_int,
pub ifmam_index: ::c_ushort,
}
pub struct ifma_msghdr2 {
pub ifmam_msglen: ::c_ushort,
pub ifmam_version: ::c_uchar,
pub ifmam_type: ::c_uchar,
pub ifmam_addrs: ::c_int,
pub ifmam_flags: ::c_int,
pub ifmam_index: ::c_ushort,
pub ifmam_refcount: i32,
}
pub struct rt_metrics {
pub rmx_locks: u32,
pub rmx_mtu: u32,
pub rmx_hopcount: u32,
pub rmx_expire: i32,
pub rmx_recvpipe: u32,
pub rmx_sendpipe: u32,
pub rmx_ssthresh: u32,
pub rmx_rtt: u32,
pub rmx_rttvar: u32,
pub rmx_pksent: u32,
pub rmx_state: u32,
pub rmx_filler: [u32; 3],
}
pub struct rt_msghdr {
pub rtm_msglen: ::c_ushort,
pub rtm_version: ::c_uchar,
pub rtm_type: ::c_uchar,
pub rtm_index: ::c_ushort,
pub rtm_flags: ::c_int,
pub rtm_addrs: ::c_int,
pub rtm_pid: ::pid_t,
pub rtm_seq: ::c_int,
pub rtm_errno: ::c_int,
pub rtm_use: ::c_int,
pub rtm_inits: u32,
pub rtm_rmx: rt_metrics,
}
pub struct rt_msghdr2 {
pub rtm_msglen: ::c_ushort,
pub rtm_version: ::c_uchar,
pub rtm_type: ::c_uchar,
pub rtm_index: ::c_ushort,
pub rtm_flags: ::c_int,
pub rtm_addrs: ::c_int,
pub rtm_refcnt: i32,
pub rtm_parentflags: ::c_int,
pub rtm_reserved: ::c_int,
pub rtm_use: ::c_int,
pub rtm_inits: u32,
pub rtm_rmx: rt_metrics,
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_cc: [::cc_t; ::NCCS],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
pub struct flock {
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
pub l_type: ::c_short,
pub l_whence: ::c_short,
}
pub struct sf_hdtr {
pub headers: *mut ::iovec,
pub hdr_cnt: ::c_int,
pub trailers: *mut ::iovec,
pub trl_cnt: ::c_int,
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct proc_taskinfo {
pub pti_virtual_size: u64,
pub pti_resident_size: u64,
pub pti_total_user: u64,
pub pti_total_system: u64,
pub pti_threads_user: u64,
pub pti_threads_system: u64,
pub pti_policy: i32,
pub pti_faults: i32,
pub pti_pageins: i32,
pub pti_cow_faults: i32,
pub pti_messages_sent: i32,
pub pti_messages_received: i32,
pub pti_syscalls_mach: i32,
pub pti_syscalls_unix: i32,
pub pti_csw: i32,
pub pti_threadnum: i32,
pub pti_numrunning: i32,
pub pti_priority: i32,
}
pub struct proc_bsdinfo {
pub pbi_flags: u32,
pub pbi_status: u32,
pub pbi_xstatus: u32,
pub pbi_pid: u32,
pub pbi_ppid: u32,
pub pbi_uid: ::uid_t,
pub pbi_gid: ::gid_t,
pub pbi_ruid: ::uid_t,
pub pbi_rgid: ::gid_t,
pub pbi_svuid: ::uid_t,
pub pbi_svgid: ::gid_t,
pub rfu_1: u32,
pub pbi_comm: [::c_char; MAXCOMLEN],
pub pbi_name: [::c_char; 32], // MAXCOMLEN * 2, but macro isn't happy...
pub pbi_nfiles: u32,
pub pbi_pgid: u32,
pub pbi_pjobc: u32,
pub e_tdev: u32,
pub e_tpgid: u32,
pub pbi_nice: i32,
pub pbi_start_tvsec: u64,
pub pbi_start_tvusec: u64,
}
pub struct proc_taskallinfo {
pub pbsd: proc_bsdinfo,
pub ptinfo: proc_taskinfo,
}
pub struct xsw_usage {
pub xsu_total: u64,
pub xsu_avail: u64,
pub xsu_used: u64,
pub xsu_pagesize: u32,
pub xsu_encrypted: ::boolean_t,
}
pub struct xucred {
pub cr_version: ::c_uint,
pub cr_uid: ::uid_t,
pub cr_ngroups: ::c_short,
pub cr_groups: [::gid_t;16]
}
#[deprecated(
since = "0.2.55",
note = "Use the `mach2` crate instead",
)]
pub struct mach_header {
pub magic: u32,
pub cputype: cpu_type_t,
pub cpusubtype: cpu_subtype_t,
pub filetype: u32,
pub ncmds: u32,
pub sizeofcmds: u32,
pub flags: u32,
}
#[deprecated(
since = "0.2.55",
note = "Use the `mach2` crate instead",
)]
pub struct mach_header_64 {
pub magic: u32,
pub cputype: cpu_type_t,
pub cpusubtype: cpu_subtype_t,
pub filetype: u32,
pub ncmds: u32,
pub sizeofcmds: u32,
pub flags: u32,
pub reserved: u32,
}
pub struct segment_command {
pub cmd: u32,
pub cmdsize: u32,
pub segname: [::c_char; 16],
pub vmaddr: u32,
pub vmsize: u32,
pub fileoff: u32,
pub filesize: u32,
pub maxprot: vm_prot_t,
pub initprot: vm_prot_t,
pub nsects: u32,
pub flags: u32,
}
pub struct segment_command_64 {
pub cmd: u32,
pub cmdsize: u32,
pub segname: [::c_char; 16],
pub vmaddr: u64,
pub vmsize: u64,
pub fileoff: u64,
pub filesize: u64,
pub maxprot: vm_prot_t,
pub initprot: vm_prot_t,
pub nsects: u32,
pub flags: u32,
}
pub struct load_command {
pub cmd: u32,
pub cmdsize: u32,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 12],
}
pub struct sockaddr_inarp {
pub sin_len: ::c_uchar,
pub sin_family: ::c_uchar,
pub sin_port: ::c_ushort,
pub sin_addr: ::in_addr,
pub sin_srcaddr: ::in_addr,
pub sin_tos: ::c_ushort,
pub sin_other: ::c_ushort,
}
pub struct sockaddr_ctl {
pub sc_len: ::c_uchar,
pub sc_family: ::c_uchar,
pub ss_sysaddr: u16,
pub sc_id: u32,
pub sc_unit: u32,
pub sc_reserved: [u32; 5],
}
pub struct in_pktinfo {
pub ipi_ifindex: ::c_uint,
pub ipi_spec_dst: ::in_addr,
pub ipi_addr: ::in_addr,
}
pub struct in6_pktinfo {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_uint,
}
// sys/ipc.h:
pub struct ipc_perm {
pub uid: ::uid_t,
pub gid: ::gid_t,
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub mode: ::mode_t,
pub _seq: ::c_ushort,
pub _key: ::key_t,
}
// sys/sem.h
pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
// sys/shm.h
pub struct arphdr {
pub ar_hrd: u16,
pub ar_pro: u16,
pub ar_hln: u8,
pub ar_pln: u8,
pub ar_op: u16,
}
pub struct in_addr {
pub s_addr: ::in_addr_t,
}
// net/ndrv.h
pub struct sockaddr_ndrv {
pub snd_len: ::c_uchar,
pub snd_family: ::c_uchar,
pub snd_name: [::c_uchar; ::IFNAMSIZ],
}
// sys/socket.h
pub struct sa_endpoints_t {
pub sae_srcif: ::c_uint, // optional source interface
pub sae_srcaddr: *const ::sockaddr, // optional source address
pub sae_srcaddrlen: ::socklen_t, // size of source address
pub sae_dstaddr: *const ::sockaddr, // destination address
pub sae_dstaddrlen: ::socklen_t, // size of destination address
}
pub struct timex {
pub modes: ::c_uint,
pub offset: ::c_long,
pub freq: ::c_long,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub status: ::c_int,
pub constant: ::c_long,
pub precision: ::c_long,
pub tolerance: ::c_long,
pub ppsfreq: ::c_long,
pub jitter: ::c_long,
pub shift: ::c_int,
pub stabil: ::c_long,
pub jitcnt: ::c_long,
pub calcnt: ::c_long,
pub errcnt: ::c_long,
pub stbcnt: ::c_long,
}
pub struct ntptimeval {
pub time: ::timespec,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub tai: ::c_long,
pub time_state: ::c_int,
}
pub struct thread_standard_policy {
pub no_data: natural_t,
}
pub struct thread_extended_policy {
pub timeshare: boolean_t,
}
pub struct thread_time_constraint_policy {
pub period: u32,
pub computation: u32,
pub constraint: u32,
pub preemptible: boolean_t,
}
pub struct thread_precedence_policy {
pub importance: integer_t,
}
pub struct thread_affinity_policy {
pub affinity_tag: integer_t,
}
pub struct thread_background_policy {
pub priority: integer_t,
}
pub struct thread_latency_qos_policy {
pub thread_latency_qos_tier: thread_latency_qos_t,
}
pub struct thread_throughput_qos_policy {
pub thread_throughput_qos_tier: thread_throughput_qos_t,
}
// malloc/malloc.h
pub struct malloc_statistics_t {
pub blocks_in_use: ::c_uint,
pub size_in_use: ::size_t,
pub max_size_in_use: ::size_t,
pub size_allocated: ::size_t,
}
pub struct mstats {
pub bytes_total: ::size_t,
pub chunks_used: ::size_t,
pub bytes_used: ::size_t,
pub chunks_free: ::size_t,
pub bytes_free: ::size_t,
}
pub struct vm_range_t {
pub address: ::vm_address_t,
pub size: ::vm_size_t,
}
// sched.h
pub struct sched_param {
pub sched_priority: ::c_int,
__opaque: [::c_char; 4],
}
pub struct vinfo_stat {
pub vst_dev: u32,
pub vst_mode: u16,
pub vst_nlink: u16,
pub vst_ino: u64,
pub vst_uid: ::uid_t,
pub vst_gid: ::gid_t,
pub vst_atime: i64,
pub vst_atimensec: i64,
pub vst_mtime: i64,
pub vst_mtimensec: i64,
pub vst_ctime: i64,
pub vst_ctimensec: i64,
pub vst_birthtime: i64,
pub vst_birthtimensec: i64,
pub vst_size: ::off_t,
pub vst_blocks: i64,
pub vst_blksize: i32,
pub vst_flags: u32,
pub vst_gen: u32,
pub vst_rdev: u32,
pub vst_qspare: [i64; 2],
}
pub struct vnode_info {
pub vi_stat: vinfo_stat,
pub vi_type: ::c_int,
pub vi_pad: ::c_int,
pub vi_fsid: ::fsid_t,
}
pub struct vnode_info_path {
pub vip_vi: vnode_info,
// Normally it's `vip_path: [::c_char; MAXPATHLEN]` but because libc supports an old rustc
// version, we go around this limitation like this.
pub vip_path: [[::c_char; 32]; 32],
}
pub struct proc_vnodepathinfo {
pub pvi_cdir: vnode_info_path,
pub pvi_rdir: vnode_info_path,
}
pub struct vm_statistics {
pub free_count: natural_t,
pub active_count: natural_t,
pub inactive_count: natural_t,
pub wire_count: natural_t,
pub zero_fill_count: natural_t,
pub reactivations: natural_t,
pub pageins: natural_t,
pub pageouts: natural_t,
pub faults: natural_t,
pub cow_faults: natural_t,
pub lookups: natural_t,
pub hits: natural_t,
pub purgeable_count: natural_t,
pub purges: natural_t,
pub speculative_count: natural_t,
}
pub struct task_thread_times_info {
pub user_time: time_value_t,
pub system_time: time_value_t,
}
pub struct rusage_info_v0 {
pub ri_uuid: [u8; 16],
pub ri_user_time: u64,
pub ri_system_time: u64,
pub ri_pkg_idle_wkups: u64,
pub ri_interrupt_wkups: u64,
pub ri_pageins: u64,
pub ri_wired_size: u64,
pub ri_resident_size: u64,
pub ri_phys_footprint: u64,
pub ri_proc_start_abstime: u64,
pub ri_proc_exit_abstime: u64,
}
pub struct rusage_info_v1 {
pub ri_uuid: [u8; 16],
pub ri_user_time: u64,
pub ri_system_time: u64,
pub ri_pkg_idle_wkups: u64,
pub ri_interrupt_wkups: u64,
pub ri_pageins: u64,
pub ri_wired_size: u64,
pub ri_resident_size: u64,
pub ri_phys_footprint: u64,
pub ri_proc_start_abstime: u64,
pub ri_proc_exit_abstime: u64,
pub ri_child_user_time: u64,
pub ri_child_system_time: u64,
pub ri_child_pkg_idle_wkups: u64,
pub ri_child_interrupt_wkups: u64,
pub ri_child_pageins: u64,
pub ri_child_elapsed_abstime: u64,
}
pub struct rusage_info_v2 {
pub ri_uuid: [u8; 16],
pub ri_user_time: u64,
pub ri_system_time: u64,
pub ri_pkg_idle_wkups: u64,
pub ri_interrupt_wkups: u64,
pub ri_pageins: u64,
pub ri_wired_size: u64,
pub ri_resident_size: u64,
pub ri_phys_footprint: u64,
pub ri_proc_start_abstime: u64,
pub ri_proc_exit_abstime: u64,
pub ri_child_user_time: u64,
pub ri_child_system_time: u64,
pub ri_child_pkg_idle_wkups: u64,
pub ri_child_interrupt_wkups: u64,
pub ri_child_pageins: u64,
pub ri_child_elapsed_abstime: u64,
pub ri_diskio_bytesread: u64,
pub ri_diskio_byteswritten: u64,
}
pub struct rusage_info_v3 {
pub ri_uuid: [u8; 16],
pub ri_user_time: u64,
pub ri_system_time: u64,
pub ri_pkg_idle_wkups: u64,
pub ri_interrupt_wkups: u64,
pub ri_pageins: u64,
pub ri_wired_size: u64,
pub ri_resident_size: u64,
pub ri_phys_footprint: u64,
pub ri_proc_start_abstime: u64,
pub ri_proc_exit_abstime: u64,
pub ri_child_user_time: u64,
pub ri_child_system_time: u64,
pub ri_child_pkg_idle_wkups: u64,
pub ri_child_interrupt_wkups: u64,
pub ri_child_pageins: u64,
pub ri_child_elapsed_abstime: u64,
pub ri_diskio_bytesread: u64,
pub ri_diskio_byteswritten: u64,
pub ri_cpu_time_qos_default: u64,
pub ri_cpu_time_qos_maintenance: u64,
pub ri_cpu_time_qos_background: u64,
pub ri_cpu_time_qos_utility: u64,
pub ri_cpu_time_qos_legacy: u64,
pub ri_cpu_time_qos_user_initiated: u64,
pub ri_cpu_time_qos_user_interactive: u64,
pub ri_billed_system_time: u64,
pub ri_serviced_system_time: u64,
}
pub struct rusage_info_v4 {
pub ri_uuid: [u8; 16],
pub ri_user_time: u64,
pub ri_system_time: u64,
pub ri_pkg_idle_wkups: u64,
pub ri_interrupt_wkups: u64,
pub ri_pageins: u64,
pub ri_wired_size: u64,
pub ri_resident_size: u64,
pub ri_phys_footprint: u64,
pub ri_proc_start_abstime: u64,
pub ri_proc_exit_abstime: u64,
pub ri_child_user_time: u64,
pub ri_child_system_time: u64,
pub ri_child_pkg_idle_wkups: u64,
pub ri_child_interrupt_wkups: u64,
pub ri_child_pageins: u64,
pub ri_child_elapsed_abstime: u64,
pub ri_diskio_bytesread: u64,
pub ri_diskio_byteswritten: u64,
pub ri_cpu_time_qos_default: u64,
pub ri_cpu_time_qos_maintenance: u64,
pub ri_cpu_time_qos_background: u64,
pub ri_cpu_time_qos_utility: u64,
pub ri_cpu_time_qos_legacy: u64,
pub ri_cpu_time_qos_user_initiated: u64,
pub ri_cpu_time_qos_user_interactive: u64,
pub ri_billed_system_time: u64,
pub ri_serviced_system_time: u64,
pub ri_logical_writes: u64,
pub ri_lifetime_max_phys_footprint: u64,
pub ri_instructions: u64,
pub ri_cycles: u64,
pub ri_billed_energy: u64,
pub ri_serviced_energy: u64,
pub ri_interval_max_phys_footprint: u64,
pub ri_runnable_time: u64,
}
pub struct image_offset {
pub uuid: ::uuid_t,
pub offset: u32,
}
pub struct attrlist {
pub bitmapcount: ::c_ushort,
pub reserved: u16,
pub commonattr: attrgroup_t,
pub volattr: attrgroup_t,
pub dirattr: attrgroup_t,
pub fileattr: attrgroup_t,
pub forkattr: attrgroup_t,
}
pub struct attrreference_t {
pub attr_dataoffset: i32,
pub attr_length: u32,
}
pub struct vol_capabilities_attr_t {
pub capabilities: vol_capabilities_set_t,
pub valid: vol_capabilities_set_t,
}
pub struct attribute_set_t {
pub commonattr: attrgroup_t,
pub volattr: attrgroup_t,
pub dirattr: attrgroup_t,
pub fileattr: attrgroup_t,
pub forkattr: attrgroup_t,
}
pub struct vol_attributes_attr_t {
pub validattr: attribute_set_t,
pub nativeattr: attribute_set_t,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct ifconf {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
#[cfg(not(libc_union))]
pub ifc_ifcu: *mut ifreq,
}
#[cfg_attr(libc_align, repr(align(8)))]
pub struct tcp_connection_info {
pub tcpi_state: u8,
pub tcpi_snd_wscale: u8,
pub tcpi_rcv_wscale: u8,
__pad1: u8,
pub tcpi_options: u32,
pub tcpi_flags: u32,
pub tcpi_rto: u32,
pub tcpi_maxseg: u32,
pub tcpi_snd_ssthresh: u32,
pub tcpi_snd_cwnd: u32,
pub tcpi_snd_wnd: u32,
pub tcpi_snd_sbbytes: u32,
pub tcpi_rcv_wnd: u32,
pub tcpi_rttcur: u32,
pub tcpi_srtt: u32,
pub tcpi_rttvar: u32,
pub tcpi_tfo_cookie_req: u32,
pub tcpi_tfo_cookie_rcv: u32,
pub tcpi_tfo_syn_loss: u32,
pub tcpi_tfo_syn_data_sent: u32,
pub tcpi_tfo_syn_data_acked: u32,
pub tcpi_tfo_syn_data_rcv: u32,
pub tcpi_tfo_cookie_req_rcv: u32,
pub tcpi_tfo_cookie_sent: u32,
pub tcpi_tfo_cookie_invalid: u32,
pub tcpi_tfo_cookie_wrong: u32,
pub tcpi_tfo_no_cookie_rcv: u32,
pub tcpi_tfo_heuristics_disable: u32,
pub tcpi_tfo_send_blackhole: u32,
pub tcpi_tfo_recv_blackhole: u32,
pub tcpi_tfo_onebyte_proxy: u32,
__pad2: u32,
pub tcpi_txpackets: u64,
pub tcpi_txbytes: u64,
pub tcpi_txretransmitbytes: u64,
pub tcpi_rxpackets: u64,
pub tcpi_rxbytes: u64,
pub tcpi_rxoutoforderbytes: u64,
pub tcpi_rxretransmitpackets: u64,
}
}
s_no_extra_traits! {
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: i16,
pub flags: u16,
pub fflags: u32,
pub data: ::intptr_t,
pub udata: *mut ::c_void,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct semid_ds {
// Note the manpage shows different types than the system header.
pub sem_perm: ipc_perm,
pub sem_base: i32,
pub sem_nsems: ::c_ushort,
pub sem_otime: ::time_t,
pub sem_pad1: i32,
pub sem_ctime: ::time_t,
pub sem_pad2: i32,
pub sem_pad3: [i32; 4],
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct shmid_ds {
pub shm_perm: ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
pub shm_dtime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
pub shm_ctime: ::time_t, // FIXME: 64-bit wrong align => wrong offset
// FIXME: 64-bit wrong align => wrong offset:
pub shm_internal: *mut ::c_void,
}
pub struct proc_threadinfo {
pub pth_user_time: u64,
pub pth_system_time: u64,
pub pth_cpu_usage: i32,
pub pth_policy: i32,
pub pth_run_state: i32,
pub pth_flags: i32,
pub pth_sleep_time: i32,
pub pth_curpri: i32,
pub pth_priority: i32,
pub pth_maxpriority: i32,
pub pth_name: [::c_char; MAXTHREADNAMESIZE],
}
pub struct statfs {
pub f_bsize: u32,
pub f_iosize: i32,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: u64,
pub f_files: u64,
pub f_ffree: u64,
pub f_fsid: ::fsid_t,
pub f_owner: ::uid_t,
pub f_type: u32,
pub f_flags: u32,
pub f_fssubtype: u32,
pub f_fstypename: [::c_char; 16],
pub f_mntonname: [::c_char; 1024],
pub f_mntfromname: [::c_char; 1024],
pub f_flags_ext: u32,
pub f_reserved: [u32; 7],
}
pub struct dirent {
pub d_ino: u64,
pub d_seekoff: u64,
pub d_reclen: u16,
pub d_namlen: u16,
pub d_type: u8,
pub d_name: [::c_char; 1024],
}
pub struct pthread_rwlock_t {
__sig: ::c_long,
__opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
}
pub struct pthread_mutex_t {
__sig: ::c_long,
__opaque: [u8; __PTHREAD_MUTEX_SIZE__],
}
pub struct pthread_cond_t {
__sig: ::c_long,
__opaque: [u8; __PTHREAD_COND_SIZE__],
}
pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: ::sa_family_t,
__ss_pad1: [u8; 6],
__ss_align: i64,
__ss_pad2: [u8; 112],
}
pub struct utmpx {
pub ut_user: [::c_char; _UTX_USERSIZE],
pub ut_id: [::c_char; _UTX_IDSIZE],
pub ut_line: [::c_char; _UTX_LINESIZE],
pub ut_pid: ::pid_t,
pub ut_type: ::c_short,
pub ut_tv: ::timeval,
pub ut_host: [::c_char; _UTX_HOSTSIZE],
ut_pad: [u32; 16],
}
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::pthread_attr_t
}
pub struct processor_cpu_load_info {
pub cpu_ticks: [::c_uint; CPU_STATE_MAX as usize],
}
pub struct processor_basic_info {
pub cpu_type: cpu_type_t,
pub cpu_subtype: cpu_subtype_t,
pub running: ::boolean_t,
pub slot_num: ::c_int,
pub is_master: ::boolean_t,
}
pub struct processor_set_basic_info {
pub processor_count: ::c_int,
pub default_policy: ::c_int,
}
pub struct processor_set_load_info {
pub task_count: ::c_int,
pub thread_count: ::c_int,
pub load_average: integer_t,
pub mach_factor: integer_t,
}
pub struct time_value_t {
pub seconds: integer_t,
pub microseconds: integer_t,
}
pub struct thread_basic_info {
pub user_time: time_value_t,
pub system_time: time_value_t,
pub cpu_usage: ::integer_t,
pub policy: ::policy_t,
pub run_state: ::integer_t,
pub flags: ::integer_t,
pub suspend_count: ::integer_t,
pub sleep_time: ::integer_t,
}
pub struct thread_identifier_info {
pub thread_id: u64,
pub thread_handle: u64,
pub dispatch_qaddr: u64,
}
pub struct thread_extended_info {
pub pth_user_time: u64,
pub pth_system_time: u64,
pub pth_cpu_usage: i32,
pub pth_policy: i32,
pub pth_run_state: i32,
pub pth_flags: i32,
pub pth_sleep_time: i32,
pub pth_curpri: i32,
pub pth_priority: i32,
pub pth_maxpriority: i32,
pub pth_name: [::c_char; MAXTHREADNAMESIZE],
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct if_data64 {
pub ifi_type: ::c_uchar,
pub ifi_typelen: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_unused1: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_baudrate: u64,
pub ifi_ipackets: u64,
pub ifi_ierrors: u64,
pub ifi_opackets: u64,
pub ifi_oerrors: u64,
pub ifi_collisions: u64,
pub ifi_ibytes: u64,
pub ifi_obytes: u64,
pub ifi_imcasts: u64,
pub ifi_omcasts: u64,
pub ifi_iqdrops: u64,
pub ifi_noproto: u64,
pub ifi_recvtiming: u32,
pub ifi_xmittiming: u32,
#[cfg(target_pointer_width = "32")]
pub ifi_lastchange: ::timeval,
#[cfg(not(target_pointer_width = "32"))]
pub ifi_lastchange: timeval32,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct if_msghdr2 {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_index: ::c_ushort,
pub ifm_snd_len: ::c_int,
pub ifm_snd_maxlen: ::c_int,
pub ifm_snd_drops: ::c_int,
pub ifm_timer: ::c_int,
pub ifm_data: if_data64,
}
#[cfg_attr(libc_packedN, repr(packed(8)))]
pub struct vm_statistics64 {
pub free_count: natural_t,
pub active_count: natural_t,
pub inactive_count: natural_t,
pub wire_count: natural_t,
pub zero_fill_count: u64,
pub reactivations: u64,
pub pageins: u64,
pub pageouts: u64,
pub faults: u64,
pub cow_faults: u64,
pub lookups: u64,
pub hits: u64,
pub purges: u64,
pub purgeable_count: natural_t,
pub speculative_count: natural_t,
pub decompressions: u64,
pub compressions: u64,
pub swapins: u64,
pub swapouts: u64,
pub compressor_page_count: natural_t,
pub throttled_count: natural_t,
pub external_page_count: natural_t,
pub internal_page_count: natural_t,
pub total_uncompressed_pages_in_compressor: u64,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct mach_task_basic_info {
pub virtual_size: mach_vm_size_t,
pub resident_size: mach_vm_size_t,
pub resident_size_max: mach_vm_size_t,
pub user_time: time_value_t,
pub system_time: time_value_t,
pub policy: ::policy_t,
pub suspend_count: integer_t,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct log2phys {
pub l2p_flags: ::c_uint,
pub l2p_contigbytes: ::off_t,
pub l2p_devoffset: ::off_t,
}
pub struct os_unfair_lock_s {
_os_unfair_lock_opaque: u32,
}
#[cfg_attr(libc_packedN, repr(packed(1)))]
pub struct sockaddr_vm {
pub svm_len: ::c_uchar,
pub svm_family: ::sa_family_t,
pub svm_reserved1: ::c_ushort,
pub svm_port: ::c_uint,
pub svm_cid: ::c_uint,
}
pub struct ifdevmtu {
pub ifdm_current: ::c_int,
pub ifdm_min: ::c_int,
pub ifdm_max: ::c_int,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifk_data {
pub ifk_ptr: *mut ::c_void,
pub ifk_value: ::c_int,
}
#[cfg_attr(libc_packedN, repr(packed(4)))]
pub struct ifkpi {
pub ifk_module_id: ::c_uint,
pub ifk_type: ::c_uint,
#[cfg(libc_union)]
pub ifk_data: __c_anonymous_ifk_data,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: ::sockaddr,
pub ifru_dstaddr: ::sockaddr,
pub ifru_broadaddr: ::sockaddr,
pub ifru_flags: ::c_short,
pub ifru_metrics: ::c_int,
pub ifru_mtu: ::c_int,
pub ifru_phys: ::c_int,
pub ifru_media: ::c_int,
pub ifru_intval: ::c_int,
pub ifru_data: *mut ::c_char,
pub ifru_devmtu: ifdevmtu,
pub ifru_kpi: ifkpi,
pub ifru_wake_flags: u32,
pub ifru_route_refcnt: u32,
pub ifru_cap: [::c_int; 2],
pub ifru_functional_type: u32,
}
pub struct ifreq {
pub ifr_name: [::c_char; ::IFNAMSIZ],
#[cfg(libc_union)]
pub ifr_ifru: __c_anonymous_ifr_ifru,
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifc_ifcu {
pub ifcu_buf: *mut ::c_char,
pub ifcu_req: *mut ifreq,
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
_si_pid: ::pid_t,
_si_uid: ::uid_t,
_si_status: ::c_int,
_si_addr: *mut ::c_void,
si_value: ::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).si_value
}
pub unsafe fn si_pid(&self) -> ::pid_t {
self.si_pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
self.si_uid
}
pub unsafe fn si_status(&self) -> ::c_int {
self.si_status
}
}
cfg_if! {
if #[cfg(libc_union)] {
s_no_extra_traits! {
pub union semun {
pub val: ::c_int,
pub buf: *mut semid_ds,
pub array: *mut ::c_ushort,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for semun {
fn eq(&self, other: &semun) -> bool {
unsafe { self.val == other.val }
}
}
impl Eq for semun {}
impl ::fmt::Debug for semun {
fn fmt(&self, f: &mut ::fmt::Formatter)
-> ::fmt::Result {
f.debug_struct("semun")
.field("val", unsafe { &self.val })
.finish()
}
}
impl ::hash::Hash for semun {
fn hash(&self, state: &mut H) {
unsafe { self.val.hash(state) };
}
}
}
}
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for kevent {
fn eq(&self, other: &kevent) -> bool {
self.ident == other.ident
&& self.filter == other.filter
&& self.flags == other.flags
&& self.fflags == other.fflags
&& self.data == other.data
&& self.udata == other.udata
}
}
impl Eq for kevent {}
impl ::fmt::Debug for kevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ident = self.ident;
let filter = self.filter;
let flags = self.flags;
let fflags = self.fflags;
let data = self.data;
let udata = self.udata;
f.debug_struct("kevent")
.field("ident", &ident)
.field("filter", &filter)
.field("flags", &flags)
.field("fflags", &fflags)
.field("data", &data)
.field("udata", &udata)
.finish()
}
}
impl ::hash::Hash for kevent {
fn hash(&self, state: &mut H) {
let ident = self.ident;
let filter = self.filter;
let flags = self.flags;
let fflags = self.fflags;
let data = self.data;
let udata = self.udata;
ident.hash(state);
filter.hash(state);
flags.hash(state);
fflags.hash(state);
data.hash(state);
udata.hash(state);
}
}
impl PartialEq for semid_ds {
fn eq(&self, other: &semid_ds) -> bool {
let sem_perm = self.sem_perm;
let sem_pad3 = self.sem_pad3;
let other_sem_perm = other.sem_perm;
let other_sem_pad3 = other.sem_pad3;
sem_perm == other_sem_perm
&& self.sem_base == other.sem_base
&& self.sem_nsems == other.sem_nsems
&& self.sem_otime == other.sem_otime
&& self.sem_pad1 == other.sem_pad1
&& self.sem_ctime == other.sem_ctime
&& self.sem_pad2 == other.sem_pad2
&& sem_pad3 == other_sem_pad3
}
}
impl Eq for semid_ds {}
impl ::fmt::Debug for semid_ds {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let sem_perm = self.sem_perm;
let sem_base = self.sem_base;
let sem_nsems = self.sem_nsems;
let sem_otime = self.sem_otime;
let sem_pad1 = self.sem_pad1;
let sem_ctime = self.sem_ctime;
let sem_pad2 = self.sem_pad2;
let sem_pad3 = self.sem_pad3;
f.debug_struct("semid_ds")
.field("sem_perm", &sem_perm)
.field("sem_base", &sem_base)
.field("sem_nsems", &sem_nsems)
.field("sem_otime", &sem_otime)
.field("sem_pad1", &sem_pad1)
.field("sem_ctime", &sem_ctime)
.field("sem_pad2", &sem_pad2)
.field("sem_pad3", &sem_pad3)
.finish()
}
}
impl ::hash::Hash for semid_ds {
fn hash(&self, state: &mut H) {
let sem_perm = self.sem_perm;
let sem_base = self.sem_base;
let sem_nsems = self.sem_nsems;
let sem_otime = self.sem_otime;
let sem_pad1 = self.sem_pad1;
let sem_ctime = self.sem_ctime;
let sem_pad2 = self.sem_pad2;
let sem_pad3 = self.sem_pad3;
sem_perm.hash(state);
sem_base.hash(state);
sem_nsems.hash(state);
sem_otime.hash(state);
sem_pad1.hash(state);
sem_ctime.hash(state);
sem_pad2.hash(state);
sem_pad3.hash(state);
}
}
impl PartialEq for shmid_ds {
fn eq(&self, other: &shmid_ds) -> bool {
let shm_perm = self.shm_perm;
let other_shm_perm = other.shm_perm;
shm_perm == other_shm_perm
&& self.shm_segsz == other.shm_segsz
&& self.shm_lpid == other.shm_lpid
&& self.shm_cpid == other.shm_cpid
&& self.shm_nattch == other.shm_nattch
&& self.shm_atime == other.shm_atime
&& self.shm_dtime == other.shm_dtime
&& self.shm_ctime == other.shm_ctime
&& self.shm_internal == other.shm_internal
}
}
impl Eq for shmid_ds {}
impl ::fmt::Debug for shmid_ds {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let shm_perm = self.shm_perm;
let shm_segsz = self.shm_segsz;
let shm_lpid = self.shm_lpid;
let shm_cpid = self.shm_cpid;
let shm_nattch = self.shm_nattch;
let shm_atime = self.shm_atime;
let shm_dtime = self.shm_dtime;
let shm_ctime = self.shm_ctime;
let shm_internal = self.shm_internal;
f.debug_struct("shmid_ds")
.field("shm_perm", &shm_perm)
.field("shm_segsz", &shm_segsz)
.field("shm_lpid", &shm_lpid)
.field("shm_cpid", &shm_cpid)
.field("shm_nattch", &shm_nattch)
.field("shm_atime", &shm_atime)
.field("shm_dtime", &shm_dtime)
.field("shm_ctime", &shm_ctime)
.field("shm_internal", &shm_internal)
.finish()
}
}
impl ::hash::Hash for shmid_ds {
fn hash(&self, state: &mut H) {
let shm_perm = self.shm_perm;
let shm_segsz = self.shm_segsz;
let shm_lpid = self.shm_lpid;
let shm_cpid = self.shm_cpid;
let shm_nattch = self.shm_nattch;
let shm_atime = self.shm_atime;
let shm_dtime = self.shm_dtime;
let shm_ctime = self.shm_ctime;
let shm_internal = self.shm_internal;
shm_perm.hash(state);
shm_segsz.hash(state);
shm_lpid.hash(state);
shm_cpid.hash(state);
shm_nattch.hash(state);
shm_atime.hash(state);
shm_dtime.hash(state);
shm_ctime.hash(state);
shm_internal.hash(state);
}
}
impl PartialEq for proc_threadinfo {
fn eq(&self, other: &proc_threadinfo) -> bool {
self.pth_user_time == other.pth_user_time
&& self.pth_system_time == other.pth_system_time
&& self.pth_cpu_usage == other.pth_cpu_usage
&& self.pth_policy == other.pth_policy
&& self.pth_run_state == other.pth_run_state
&& self.pth_flags == other.pth_flags
&& self.pth_sleep_time == other.pth_sleep_time
&& self.pth_curpri == other.pth_curpri
&& self.pth_priority == other.pth_priority
&& self.pth_maxpriority == other.pth_maxpriority
&& self.pth_name
.iter()
.zip(other.pth_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for proc_threadinfo {}
impl ::fmt::Debug for proc_threadinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("proc_threadinfo")
.field("pth_user_time", &self.pth_user_time)
.field("pth_system_time", &self.pth_system_time)
.field("pth_cpu_usage", &self.pth_cpu_usage)
.field("pth_policy", &self.pth_policy)
.field("pth_run_state", &self.pth_run_state)
.field("pth_flags", &self.pth_flags)
.field("pth_sleep_time", &self.pth_sleep_time)
.field("pth_curpri", &self.pth_curpri)
.field("pth_priority", &self.pth_priority)
.field("pth_maxpriority", &self.pth_maxpriority)
// FIXME: .field("pth_name", &self.pth_name)
.finish()
}
}
impl ::hash::Hash for proc_threadinfo {
fn hash(&self, state: &mut H) {
self.pth_user_time.hash(state);
self.pth_system_time.hash(state);
self.pth_cpu_usage.hash(state);
self.pth_policy.hash(state);
self.pth_run_state.hash(state);
self.pth_flags.hash(state);
self.pth_sleep_time.hash(state);
self.pth_curpri.hash(state);
self.pth_priority.hash(state);
self.pth_maxpriority.hash(state);
self.pth_name.hash(state);
}
}
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_fsid == other.f_fsid
&& self.f_owner == other.f_owner
&& self.f_flags == other.f_flags
&& self.f_fssubtype == other.f_fssubtype
&& self.f_fstypename == other.f_fstypename
&& self.f_type == other.f_type
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self.f_reserved == other.f_reserved
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_fsid", &self.f_fsid)
.field("f_owner", &self.f_owner)
.field("f_flags", &self.f_flags)
.field("f_fssubtype", &self.f_fssubtype)
.field("f_fstypename", &self.f_fstypename)
.field("f_type", &self.f_type)
// FIXME: .field("f_mntonname", &self.f_mntonname)
// FIXME: .field("f_mntfromname", &self.f_mntfromname)
.field("f_reserved", &self.f_reserved)
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_fsid.hash(state);
self.f_owner.hash(state);
self.f_flags.hash(state);
self.f_fssubtype.hash(state);
self.f_fstypename.hash(state);
self.f_type.hash(state);
self.f_mntonname.hash(state);
self.f_mntfromname.hash(state);
self.f_reserved.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_ino == other.d_ino
&& self.d_seekoff == other.d_seekoff
&& self.d_reclen == other.d_reclen
&& self.d_namlen == other.d_namlen
&& self.d_type == other.d_type
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_ino", &self.d_ino)
.field("d_seekoff", &self.d_seekoff)
.field("d_reclen", &self.d_reclen)
.field("d_namlen", &self.d_namlen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_ino.hash(state);
self.d_seekoff.hash(state);
self.d_reclen.hash(state);
self.d_namlen.hash(state);
self.d_type.hash(state);
self.d_name.hash(state);
}
}
impl PartialEq for pthread_rwlock_t {
fn eq(&self, other: &pthread_rwlock_t) -> bool {
self.__sig == other.__sig
&& self.
__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_rwlock_t {}
impl ::fmt::Debug for pthread_rwlock_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_rwlock_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_rwlock_t {
fn hash(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
impl PartialEq for pthread_mutex_t {
fn eq(&self, other: &pthread_mutex_t) -> bool {
self.__sig == other.__sig
&& self.
__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_mutex_t {}
impl ::fmt::Debug for pthread_mutex_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_mutex_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_mutex_t {
fn hash(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
impl PartialEq for pthread_cond_t {
fn eq(&self, other: &pthread_cond_t) -> bool {
self.__sig == other.__sig
&& self.
__opaque
.iter()
.zip(other.__opaque.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for pthread_cond_t {}
impl ::fmt::Debug for pthread_cond_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("pthread_cond_t")
.field("__sig", &self.__sig)
// FIXME: .field("__opaque", &self.__opaque)
.finish()
}
}
impl ::hash::Hash for pthread_cond_t {
fn hash(&self, state: &mut H) {
self.__sig.hash(state);
self.__opaque.hash(state);
}
}
impl PartialEq for sockaddr_storage {
fn eq(&self, other: &sockaddr_storage) -> bool {
self.ss_len == other.ss_len
&& self.ss_family == other.ss_family
&& self
.__ss_pad1
.iter()
.zip(other.__ss_pad1.iter())
.all(|(a, b)| a == b)
&& self.__ss_align == other.__ss_align
&& self
.__ss_pad2
.iter()
.zip(other.__ss_pad2.iter())
.all(|(a, b)| a == b)
}
}
impl Eq for sockaddr_storage {}
impl ::fmt::Debug for sockaddr_storage {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_storage")
.field("ss_len", &self.ss_len)
.field("ss_family", &self.ss_family)
.field("__ss_pad1", &self.__ss_pad1)
.field("__ss_align", &self.__ss_align)
// FIXME: .field("__ss_pad2", &self.__ss_pad2)
.finish()
}
}
impl ::hash::Hash for sockaddr_storage {
fn hash(&self, state: &mut H) {
self.ss_len.hash(state);
self.ss_family.hash(state);
self.__ss_pad1.hash(state);
self.__ss_align.hash(state);
self.__ss_pad2.hash(state);
}
}
impl PartialEq for utmpx {
fn eq(&self, other: &utmpx) -> bool {
self.ut_user
.iter()
.zip(other.ut_user.iter())
.all(|(a,b)| a == b)
&& self.ut_id == other.ut_id
&& self.ut_line == other.ut_line
&& self.ut_pid == other.ut_pid
&& self.ut_type == other.ut_type
&& self.ut_tv == other.ut_tv
&& self
.ut_host
.iter()
.zip(other.ut_host.iter())
.all(|(a,b)| a == b)
&& self.ut_pad == other.ut_pad
}
}
impl Eq for utmpx {}
impl ::fmt::Debug for utmpx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utmpx")
// FIXME: .field("ut_user", &self.ut_user)
.field("ut_id", &self.ut_id)
.field("ut_line", &self.ut_line)
.field("ut_pid", &self.ut_pid)
.field("ut_type", &self.ut_type)
.field("ut_tv", &self.ut_tv)
// FIXME: .field("ut_host", &self.ut_host)
.field("ut_pad", &self.ut_pad)
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash(&self, state: &mut H) {
self.ut_user.hash(state);
self.ut_id.hash(state);
self.ut_line.hash(state);
self.ut_pid.hash(state);
self.ut_type.hash(state);
self.ut_tv.hash(state);
self.ut_host.hash(state);
self.ut_pad.hash(state);
}
}
impl PartialEq for sigevent {
fn eq(&self, other: &sigevent) -> bool {
self.sigev_notify == other.sigev_notify
&& self.sigev_signo == other.sigev_signo
&& self.sigev_value == other.sigev_value
&& self.sigev_notify_attributes
== other.sigev_notify_attributes
}
}
impl Eq for sigevent {}
impl ::fmt::Debug for sigevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigevent")
.field("sigev_notify", &self.sigev_notify)
.field("sigev_signo", &self.sigev_signo)
.field("sigev_value", &self.sigev_value)
.field("sigev_notify_attributes",
&self.sigev_notify_attributes)
.finish()
}
}
impl ::hash::Hash for sigevent {
fn hash(&self, state: &mut H) {
self.sigev_notify.hash(state);
self.sigev_signo.hash(state);
self.sigev_value.hash(state);
self.sigev_notify_attributes.hash(state);
}
}
impl PartialEq for processor_cpu_load_info {
fn eq(&self, other: &processor_cpu_load_info) -> bool {
self.cpu_ticks == other.cpu_ticks
}
}
impl Eq for processor_cpu_load_info {}
impl ::fmt::Debug for processor_cpu_load_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("processor_cpu_load_info")
.field("cpu_ticks", &self.cpu_ticks)
.finish()
}
}
impl ::hash::Hash for processor_cpu_load_info {
fn hash(&self, state: &mut H) {
self.cpu_ticks.hash(state);
}
}
impl PartialEq for processor_basic_info {
fn eq(&self, other: &processor_basic_info) -> bool {
self.cpu_type == other.cpu_type
&& self.cpu_subtype == other.cpu_subtype
&& self.running == other.running
&& self.slot_num == other.slot_num
&& self.is_master == other.is_master
}
}
impl Eq for processor_basic_info {}
impl ::fmt::Debug for processor_basic_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("processor_basic_info")
.field("cpu_type", &self.cpu_type)
.field("cpu_subtype", &self.cpu_subtype)
.field("running", &self.running)
.field("slot_num", &self.slot_num)
.field("is_master", &self.is_master)
.finish()
}
}
impl ::hash::Hash for processor_basic_info {
fn hash(&self, state: &mut H) {
self.cpu_type.hash(state);
self.cpu_subtype.hash(state);
self.running.hash(state);
self.slot_num.hash(state);
self.is_master.hash(state);
}
}
impl PartialEq for processor_set_basic_info {
fn eq(&self, other: &processor_set_basic_info) -> bool {
self.processor_count == other.processor_count
&& self.default_policy == other.default_policy
}
}
impl Eq for processor_set_basic_info {}
impl ::fmt::Debug for processor_set_basic_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("processor_set_basic_info")
.field("processor_count", &self.processor_count)
.field("default_policy", &self.default_policy)
.finish()
}
}
impl ::hash::Hash for processor_set_basic_info {
fn hash(&self, state: &mut H) {
self.processor_count.hash(state);
self.default_policy.hash(state);
}
}
impl PartialEq for processor_set_load_info {
fn eq(&self, other: &processor_set_load_info) -> bool {
self.task_count == other.task_count
&& self.thread_count == other.thread_count
&& self.load_average == other.load_average
&& self.mach_factor == other.mach_factor
}
}
impl Eq for processor_set_load_info {}
impl ::fmt::Debug for processor_set_load_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("processor_set_load_info")
.field("task_count", &self.task_count)
.field("thread_count", &self.thread_count)
.field("load_average", &self.load_average)
.field("mach_factor", &self.mach_factor)
.finish()
}
}
impl ::hash::Hash for processor_set_load_info {
fn hash(&self, state: &mut H) {
self.task_count.hash(state);
self.thread_count.hash(state);
self.load_average.hash(state);
self.mach_factor.hash(state);
}
}
impl PartialEq for time_value_t {
fn eq(&self, other: &time_value_t) -> bool {
self.seconds == other.seconds
&& self.microseconds == other.microseconds
}
}
impl Eq for time_value_t {}
impl ::fmt::Debug for time_value_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("time_value_t")
.field("seconds", &self.seconds)
.field("microseconds", &self.microseconds)
.finish()
}
}
impl ::hash::Hash for time_value_t {
fn hash(&self, state: &mut H) {
self.seconds.hash(state);
self.microseconds.hash(state);
}
}
impl PartialEq for thread_basic_info {
fn eq(&self, other: &thread_basic_info) -> bool {
self.user_time == other.user_time
&& self.system_time == other.system_time
&& self.cpu_usage == other.cpu_usage
&& self.policy == other.policy
&& self.run_state == other.run_state
&& self.flags == other.flags
&& self.suspend_count == other.suspend_count
&& self.sleep_time == other.sleep_time
}
}
impl Eq for thread_basic_info {}
impl ::fmt::Debug for thread_basic_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("thread_basic_info")
.field("user_time", &self.user_time)
.field("system_time", &self.system_time)
.field("cpu_usage", &self.cpu_usage)
.field("policy", &self.policy)
.field("run_state", &self.run_state)
.field("flags", &self.flags)
.field("suspend_count", &self.suspend_count)
.field("sleep_time", &self.sleep_time)
.finish()
}
}
impl ::hash::Hash for thread_basic_info {
fn hash(&self, state: &mut H) {
self.user_time.hash(state);
self.system_time.hash(state);
self.cpu_usage.hash(state);
self.policy.hash(state);
self.run_state.hash(state);
self.flags.hash(state);
self.suspend_count.hash(state);
self.sleep_time.hash(state);
}
}
impl PartialEq for thread_extended_info {
fn eq(&self, other: &thread_extended_info) -> bool {
self.pth_user_time == other.pth_user_time
&& self.pth_system_time == other.pth_system_time
&& self.pth_cpu_usage == other.pth_cpu_usage
&& self.pth_policy == other.pth_policy
&& self.pth_run_state == other.pth_run_state
&& self.pth_flags == other.pth_flags
&& self.pth_sleep_time == other.pth_sleep_time
&& self.pth_curpri == other.pth_curpri
&& self.pth_priority == other.pth_priority
&& self.pth_maxpriority == other.pth_maxpriority
&& self.pth_name
.iter()
.zip(other.pth_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for thread_extended_info {}
impl ::fmt::Debug for thread_extended_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("proc_threadinfo")
.field("pth_user_time", &self.pth_user_time)
.field("pth_system_time", &self.pth_system_time)
.field("pth_cpu_usage", &self.pth_cpu_usage)
.field("pth_policy", &self.pth_policy)
.field("pth_run_state", &self.pth_run_state)
.field("pth_flags", &self.pth_flags)
.field("pth_sleep_time", &self.pth_sleep_time)
.field("pth_curpri", &self.pth_curpri)
.field("pth_priority", &self.pth_priority)
.field("pth_maxpriority", &self.pth_maxpriority)
// FIXME: .field("pth_name", &self.pth_name)
.finish()
}
}
impl ::hash::Hash for thread_extended_info {
fn hash(&self, state: &mut H) {
self.pth_user_time.hash(state);
self.pth_system_time.hash(state);
self.pth_cpu_usage.hash(state);
self.pth_policy.hash(state);
self.pth_run_state.hash(state);
self.pth_flags.hash(state);
self.pth_sleep_time.hash(state);
self.pth_curpri.hash(state);
self.pth_priority.hash(state);
self.pth_maxpriority.hash(state);
self.pth_name.hash(state);
}
}
impl PartialEq for thread_identifier_info {
fn eq(&self, other: &thread_identifier_info) -> bool {
self.thread_id == other.thread_id
&& self.thread_handle == other.thread_handle
&& self.dispatch_qaddr == other.dispatch_qaddr
}
}
impl Eq for thread_identifier_info {}
impl ::fmt::Debug for thread_identifier_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("thread_identifier_info")
.field("thread_id", &self.thread_id)
.field("thread_handle", &self.thread_handle)
.field("dispatch_qaddr", &self.dispatch_qaddr)
.finish()
}
}
impl ::hash::Hash for thread_identifier_info {
fn hash(&self, state: &mut H) {
self.thread_id.hash(state);
self.thread_handle.hash(state);
self.dispatch_qaddr.hash(state);
}
}
impl PartialEq for if_data64 {
fn eq(&self, other: &if_data64) -> bool {
self.ifi_type == other.ifi_type &&
self.ifi_typelen == other.ifi_typelen &&
self.ifi_physical == other.ifi_physical &&
self.ifi_addrlen == other.ifi_addrlen &&
self.ifi_hdrlen == other.ifi_hdrlen &&
self.ifi_recvquota == other.ifi_recvquota &&
self.ifi_xmitquota == other.ifi_xmitquota &&
self.ifi_unused1 == other.ifi_unused1 &&
self.ifi_mtu == other.ifi_mtu &&
self.ifi_metric == other.ifi_metric &&
self.ifi_baudrate == other.ifi_baudrate &&
self.ifi_ipackets == other.ifi_ipackets &&
self.ifi_ierrors == other.ifi_ierrors &&
self.ifi_opackets == other.ifi_opackets &&
self.ifi_oerrors == other.ifi_oerrors &&
self.ifi_collisions == other.ifi_collisions &&
self.ifi_ibytes == other.ifi_ibytes &&
self.ifi_obytes == other.ifi_obytes &&
self.ifi_imcasts == other.ifi_imcasts &&
self.ifi_omcasts == other.ifi_omcasts &&
self.ifi_iqdrops == other.ifi_iqdrops &&
self.ifi_noproto == other.ifi_noproto &&
self.ifi_recvtiming == other.ifi_recvtiming &&
self.ifi_xmittiming == other.ifi_xmittiming &&
self.ifi_lastchange == other.ifi_lastchange
}
}
impl Eq for if_data64 {}
impl ::fmt::Debug for if_data64 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ifi_type = self.ifi_type;
let ifi_typelen = self.ifi_typelen;
let ifi_physical = self.ifi_physical;
let ifi_addrlen = self.ifi_addrlen;
let ifi_hdrlen = self.ifi_hdrlen;
let ifi_recvquota = self.ifi_recvquota;
let ifi_xmitquota = self.ifi_xmitquota;
let ifi_unused1 = self.ifi_unused1;
let ifi_mtu = self.ifi_mtu;
let ifi_metric = self.ifi_metric;
let ifi_baudrate = self.ifi_baudrate;
let ifi_ipackets = self.ifi_ipackets;
let ifi_ierrors = self.ifi_ierrors;
let ifi_opackets = self.ifi_opackets;
let ifi_oerrors = self.ifi_oerrors;
let ifi_collisions = self.ifi_collisions;
let ifi_ibytes = self.ifi_ibytes;
let ifi_obytes = self.ifi_obytes;
let ifi_imcasts = self.ifi_imcasts;
let ifi_omcasts = self.ifi_omcasts;
let ifi_iqdrops = self.ifi_iqdrops;
let ifi_noproto = self.ifi_noproto;
let ifi_recvtiming = self.ifi_recvtiming;
let ifi_xmittiming = self.ifi_xmittiming;
let ifi_lastchange = self.ifi_lastchange;
f.debug_struct("if_data64")
.field("ifi_type", &ifi_type)
.field("ifi_typelen", &ifi_typelen)
.field("ifi_physical", &ifi_physical)
.field("ifi_addrlen", &ifi_addrlen)
.field("ifi_hdrlen", &ifi_hdrlen)
.field("ifi_recvquota", &ifi_recvquota)
.field("ifi_xmitquota", &ifi_xmitquota)
.field("ifi_unused1", &ifi_unused1)
.field("ifi_mtu", &ifi_mtu)
.field("ifi_metric", &ifi_metric)
.field("ifi_baudrate", &ifi_baudrate)
.field("ifi_ipackets", &ifi_ipackets)
.field("ifi_ierrors", &ifi_ierrors)
.field("ifi_opackets", &ifi_opackets)
.field("ifi_oerrors", &ifi_oerrors)
.field("ifi_collisions", &ifi_collisions)
.field("ifi_ibytes", &ifi_ibytes)
.field("ifi_obytes", &ifi_obytes)
.field("ifi_imcasts", &ifi_imcasts)
.field("ifi_omcasts", &ifi_omcasts)
.field("ifi_iqdrops", &ifi_iqdrops)
.field("ifi_noproto", &ifi_noproto)
.field("ifi_recvtiming", &ifi_recvtiming)
.field("ifi_xmittiming", &ifi_xmittiming)
.field("ifi_lastchange", &ifi_lastchange)
.finish()
}
}
impl ::hash::Hash for if_data64 {
fn hash(&self, state: &mut H) {
let ifi_type = self.ifi_type;
let ifi_typelen = self.ifi_typelen;
let ifi_physical = self.ifi_physical;
let ifi_addrlen = self.ifi_addrlen;
let ifi_hdrlen = self.ifi_hdrlen;
let ifi_recvquota = self.ifi_recvquota;
let ifi_xmitquota = self.ifi_xmitquota;
let ifi_unused1 = self.ifi_unused1;
let ifi_mtu = self.ifi_mtu;
let ifi_metric = self.ifi_metric;
let ifi_baudrate = self.ifi_baudrate;
let ifi_ipackets = self.ifi_ipackets;
let ifi_ierrors = self.ifi_ierrors;
let ifi_opackets = self.ifi_opackets;
let ifi_oerrors = self.ifi_oerrors;
let ifi_collisions = self.ifi_collisions;
let ifi_ibytes = self.ifi_ibytes;
let ifi_obytes = self.ifi_obytes;
let ifi_imcasts = self.ifi_imcasts;
let ifi_omcasts = self.ifi_omcasts;
let ifi_iqdrops = self.ifi_iqdrops;
let ifi_noproto = self.ifi_noproto;
let ifi_recvtiming = self.ifi_recvtiming;
let ifi_xmittiming = self.ifi_xmittiming;
let ifi_lastchange = self.ifi_lastchange;
ifi_type.hash(state);
ifi_typelen.hash(state);
ifi_physical.hash(state);
ifi_addrlen.hash(state);
ifi_hdrlen.hash(state);
ifi_recvquota.hash(state);
ifi_xmitquota.hash(state);
ifi_unused1.hash(state);
ifi_mtu.hash(state);
ifi_metric.hash(state);
ifi_baudrate.hash(state);
ifi_ipackets.hash(state);
ifi_ierrors.hash(state);
ifi_opackets.hash(state);
ifi_oerrors.hash(state);
ifi_collisions.hash(state);
ifi_ibytes.hash(state);
ifi_obytes.hash(state);
ifi_imcasts.hash(state);
ifi_omcasts.hash(state);
ifi_iqdrops.hash(state);
ifi_noproto.hash(state);
ifi_recvtiming.hash(state);
ifi_xmittiming.hash(state);
ifi_lastchange.hash(state);
}
}
impl PartialEq for if_msghdr2 {
fn eq(&self, other: &if_msghdr2) -> bool {
self.ifm_msglen == other.ifm_msglen &&
self.ifm_version == other.ifm_version &&
self.ifm_type == other.ifm_type &&
self.ifm_addrs == other.ifm_addrs &&
self.ifm_flags == other.ifm_flags &&
self.ifm_index == other.ifm_index &&
self.ifm_snd_len == other.ifm_snd_len &&
self.ifm_snd_maxlen == other.ifm_snd_maxlen &&
self.ifm_snd_drops == other.ifm_snd_drops &&
self.ifm_timer == other.ifm_timer &&
self.ifm_data == other.ifm_data
}
}
impl Eq for if_msghdr2 {}
impl ::fmt::Debug for if_msghdr2 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ifm_msglen = self.ifm_msglen;
let ifm_version = self.ifm_version;
let ifm_type = self.ifm_type;
let ifm_addrs = self.ifm_addrs;
let ifm_flags = self.ifm_flags;
let ifm_index = self.ifm_index;
let ifm_snd_len = self.ifm_snd_len;
let ifm_snd_maxlen = self.ifm_snd_maxlen;
let ifm_snd_drops = self.ifm_snd_drops;
let ifm_timer = self.ifm_timer;
let ifm_data = self.ifm_data;
f.debug_struct("if_msghdr2")
.field("ifm_msglen", &ifm_msglen)
.field("ifm_version", &ifm_version)
.field("ifm_type", &ifm_type)
.field("ifm_addrs", &ifm_addrs)
.field("ifm_flags", &ifm_flags)
.field("ifm_index", &ifm_index)
.field("ifm_snd_len", &ifm_snd_len)
.field("ifm_snd_maxlen", &ifm_snd_maxlen)
.field("ifm_snd_drops", &ifm_snd_drops)
.field("ifm_timer", &ifm_timer)
.field("ifm_data", &ifm_data)
.finish()
}
}
impl ::hash::Hash for if_msghdr2 {
fn hash(&self, state: &mut H) {
let ifm_msglen = self.ifm_msglen;
let ifm_version = self.ifm_version;
let ifm_type = self.ifm_type;
let ifm_addrs = self.ifm_addrs;
let ifm_flags = self.ifm_flags;
let ifm_index = self.ifm_index;
let ifm_snd_len = self.ifm_snd_len;
let ifm_snd_maxlen = self.ifm_snd_maxlen;
let ifm_snd_drops = self.ifm_snd_drops;
let ifm_timer = self.ifm_timer;
let ifm_data = self.ifm_data;
ifm_msglen.hash(state);
ifm_version.hash(state);
ifm_type.hash(state);
ifm_addrs.hash(state);
ifm_flags.hash(state);
ifm_index.hash(state);
ifm_snd_len.hash(state);
ifm_snd_maxlen.hash(state);
ifm_snd_drops.hash(state);
ifm_timer.hash(state);
ifm_data.hash(state);
}
}
impl PartialEq for vm_statistics64 {
fn eq(&self, other: &vm_statistics64) -> bool {
// Otherwise rustfmt crashes...
let total_uncompressed = self.total_uncompressed_pages_in_compressor;
self.free_count == other.free_count &&
self.active_count == other.active_count &&
self.inactive_count == other.inactive_count &&
self.wire_count == other.wire_count &&
self.zero_fill_count == other.zero_fill_count &&
self.reactivations == other.reactivations &&
self.pageins == other.pageins &&
self.pageouts == other.pageouts &&
self.faults == other.faults &&
self.cow_faults == other.cow_faults &&
self.lookups == other.lookups &&
self.hits == other.hits &&
self.purges == other.purges &&
self.purgeable_count == other.purgeable_count &&
self.speculative_count == other.speculative_count &&
self.decompressions == other.decompressions &&
self.compressions == other.compressions &&
self.swapins == other.swapins &&
self.swapouts == other.swapouts &&
self.compressor_page_count == other.compressor_page_count &&
self.throttled_count == other.throttled_count &&
self.external_page_count == other.external_page_count &&
self.internal_page_count == other.internal_page_count &&
total_uncompressed == other.total_uncompressed_pages_in_compressor
}
}
impl Eq for vm_statistics64 {}
impl ::fmt::Debug for vm_statistics64 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let free_count = self.free_count;
let active_count = self.active_count;
let inactive_count = self.inactive_count;
let wire_count = self.wire_count;
let zero_fill_count = self.zero_fill_count;
let reactivations = self.reactivations;
let pageins = self.pageins;
let pageouts = self.pageouts;
let faults = self.faults;
let cow_faults = self.cow_faults;
let lookups = self.lookups;
let hits = self.hits;
let purges = self.purges;
let purgeable_count = self.purgeable_count;
let speculative_count = self.speculative_count;
let decompressions = self.decompressions;
let compressions = self.compressions;
let swapins = self.swapins;
let swapouts = self.swapouts;
let compressor_page_count = self.compressor_page_count;
let throttled_count = self.throttled_count;
let external_page_count = self.external_page_count;
let internal_page_count = self.internal_page_count;
// Otherwise rustfmt crashes...
let total_uncompressed = self.total_uncompressed_pages_in_compressor;
f.debug_struct("vm_statistics64")
.field("free_count", &free_count)
.field("active_count", &active_count)
.field("inactive_count", &inactive_count)
.field("wire_count", &wire_count)
.field("zero_fill_count", &zero_fill_count)
.field("reactivations", &reactivations)
.field("pageins", &pageins)
.field("pageouts", &pageouts)
.field("faults", &faults)
.field("cow_faults", &cow_faults)
.field("lookups", &lookups)
.field("hits", &hits)
.field("purges", &purges)
.field("purgeable_count", &purgeable_count)
.field("speculative_count", &speculative_count)
.field("decompressions", &decompressions)
.field("compressions", &compressions)
.field("swapins", &swapins)
.field("swapouts", &swapouts)
.field("compressor_page_count", &compressor_page_count)
.field("throttled_count", &throttled_count)
.field("external_page_count", &external_page_count)
.field("internal_page_count", &internal_page_count)
.field("total_uncompressed_pages_in_compressor", &total_uncompressed)
.finish()
}
}
impl ::hash::Hash for vm_statistics64 {
fn hash(&self, state: &mut H) {
let free_count = self.free_count;
let active_count = self.active_count;
let inactive_count = self.inactive_count;
let wire_count = self.wire_count;
let zero_fill_count = self.zero_fill_count;
let reactivations = self.reactivations;
let pageins = self.pageins;
let pageouts = self.pageouts;
let faults = self.faults;
let cow_faults = self.cow_faults;
let lookups = self.lookups;
let hits = self.hits;
let purges = self.purges;
let purgeable_count = self.purgeable_count;
let speculative_count = self.speculative_count;
let decompressions = self.decompressions;
let compressions = self.compressions;
let swapins = self.swapins;
let swapouts = self.swapouts;
let compressor_page_count = self.compressor_page_count;
let throttled_count = self.throttled_count;
let external_page_count = self.external_page_count;
let internal_page_count = self.internal_page_count;
// Otherwise rustfmt crashes...
let total_uncompressed = self.total_uncompressed_pages_in_compressor;
free_count.hash(state);
active_count.hash(state);
inactive_count.hash(state);
wire_count.hash(state);
zero_fill_count.hash(state);
reactivations.hash(state);
pageins.hash(state);
pageouts.hash(state);
faults.hash(state);
cow_faults.hash(state);
lookups.hash(state);
hits.hash(state);
purges.hash(state);
purgeable_count.hash(state);
speculative_count.hash(state);
decompressions.hash(state);
compressions.hash(state);
swapins.hash(state);
swapouts.hash(state);
compressor_page_count.hash(state);
throttled_count.hash(state);
external_page_count.hash(state);
internal_page_count.hash(state);
total_uncompressed.hash(state);
}
}
impl PartialEq for mach_task_basic_info {
fn eq(&self, other: &mach_task_basic_info) -> bool {
self.virtual_size == other.virtual_size
&& self.resident_size == other.resident_size
&& self.resident_size_max == other.resident_size_max
&& self.user_time == other.user_time
&& self.system_time == other.system_time
&& self.policy == other.policy
&& self.suspend_count == other.suspend_count
}
}
impl Eq for mach_task_basic_info {}
impl ::fmt::Debug for mach_task_basic_info {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let virtual_size = self.virtual_size;
let resident_size = self.resident_size;
let resident_size_max = self.resident_size_max;
let user_time = self.user_time;
let system_time = self.system_time;
let policy = self.policy;
let suspend_count = self.suspend_count;
f.debug_struct("mach_task_basic_info")
.field("virtual_size", &virtual_size)
.field("resident_size", &resident_size)
.field("resident_size_max", &resident_size_max)
.field("user_time", &user_time)
.field("system_time", &system_time)
.field("policy", &policy)
.field("suspend_count", &suspend_count)
.finish()
}
}
impl ::hash::Hash for mach_task_basic_info {
fn hash(&self, state: &mut H) {
let virtual_size = self.virtual_size;
let resident_size = self.resident_size;
let resident_size_max = self.resident_size_max;
let user_time = self.user_time;
let system_time = self.system_time;
let policy = self.policy;
let suspend_count = self.suspend_count;
virtual_size.hash(state);
resident_size.hash(state);
resident_size_max.hash(state);
user_time.hash(state);
system_time.hash(state);
policy.hash(state);
suspend_count.hash(state);
}
}
impl PartialEq for log2phys {
fn eq(&self, other: &log2phys) -> bool {
self.l2p_flags == other.l2p_flags
&& self.l2p_contigbytes == other.l2p_contigbytes
&& self.l2p_devoffset == other.l2p_devoffset
}
}
impl Eq for log2phys {}
impl ::fmt::Debug for log2phys {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let l2p_flags = self.l2p_flags;
let l2p_contigbytes = self.l2p_contigbytes;
let l2p_devoffset = self.l2p_devoffset;
f.debug_struct("log2phys")
.field("l2p_flags", &l2p_flags)
.field("l2p_contigbytes", &l2p_contigbytes)
.field("l2p_devoffset", &l2p_devoffset)
.finish()
}
}
impl ::hash::Hash for log2phys {
fn hash(&self, state: &mut H) {
let l2p_flags = self.l2p_flags;
let l2p_contigbytes = self.l2p_contigbytes;
let l2p_devoffset = self.l2p_devoffset;
l2p_flags.hash(state);
l2p_contigbytes.hash(state);
l2p_devoffset.hash(state);
}
}
impl PartialEq for os_unfair_lock {
fn eq(&self, other: &os_unfair_lock) -> bool {
self._os_unfair_lock_opaque == other._os_unfair_lock_opaque
}
}
impl Eq for os_unfair_lock {}
impl ::fmt::Debug for os_unfair_lock {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("os_unfair_lock")
.field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque)
.finish()
}
}
impl ::hash::Hash for os_unfair_lock {
fn hash(&self, state: &mut H) {
self._os_unfair_lock_opaque.hash(state);
}
}
impl PartialEq for sockaddr_vm {
fn eq(&self, other: &sockaddr_vm) -> bool {
self.svm_len == other.svm_len
&& self.svm_family == other.svm_family
&& self.svm_reserved1 == other.svm_reserved1
&& self.svm_port == other.svm_port
&& self.svm_cid == other.svm_cid
}
}
impl Eq for sockaddr_vm {}
impl ::fmt::Debug for sockaddr_vm {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let svm_len = self.svm_len;
let svm_family = self.svm_family;
let svm_reserved1 = self.svm_reserved1;
let svm_port = self.svm_port;
let svm_cid = self.svm_cid;
f.debug_struct("sockaddr_vm")
.field("svm_len",&svm_len)
.field("svm_family",&svm_family)
.field("svm_reserved1",&svm_reserved1)
.field("svm_port",&svm_port)
.field("svm_cid",&svm_cid)
.finish()
}
}
impl ::hash::Hash for sockaddr_vm {
fn hash(&self, state: &mut H) {
let svm_len = self.svm_len;
let svm_family = self.svm_family;
let svm_reserved1 = self.svm_reserved1;
let svm_port = self.svm_port;
let svm_cid = self.svm_cid;
svm_len.hash(state);
svm_family.hash(state);
svm_reserved1.hash(state);
svm_port.hash(state);
svm_cid.hash(state);
}
}
impl PartialEq for ifdevmtu {
fn eq(&self, other: &ifdevmtu) -> bool {
self.ifdm_current == other.ifdm_current
&& self.ifdm_min == other.ifdm_min
&& self.ifdm_max == other.ifdm_max
}
}
impl Eq for ifdevmtu {}
impl ::fmt::Debug for ifdevmtu {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifdevmtu")
.field("ifdm_current", &self.ifdm_current)
.field("ifdm_min", &self.ifdm_min)
.field("ifdm_max", &self.ifdm_max)
.finish()
}
}
impl ::hash::Hash for ifdevmtu {
fn hash(&self, state: &mut H) {
self.ifdm_current.hash(state);
self.ifdm_min.hash(state);
self.ifdm_max.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifk_data {
fn eq(&self, other: &__c_anonymous_ifk_data) -> bool {
unsafe {
self.ifk_ptr == other.ifk_ptr
&& self.ifk_value == other.ifk_value
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifk_data {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifk_data {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__c_anonymous_ifk_data")
.field("ifk_ptr", unsafe { &self.ifk_ptr })
.field("ifk_value", unsafe { &self.ifk_value })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifk_data {
fn hash(&self, state: &mut H) {
unsafe {
self.ifk_ptr.hash(state);
self.ifk_value.hash(state);
}
}
}
impl PartialEq for ifkpi {
fn eq(&self, other: &ifkpi) -> bool {
self.ifk_module_id == other.ifk_module_id
&& self.ifk_type == other.ifk_type
}
}
impl Eq for ifkpi {}
impl ::fmt::Debug for ifkpi {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifkpi")
.field("ifk_module_id", &self.ifk_module_id)
.field("ifk_type", &self.ifk_type)
.finish()
}
}
impl ::hash::Hash for ifkpi {
fn hash(&self, state: &mut H) {
self.ifk_module_id.hash(state);
self.ifk_type.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifr_ifru {
fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
unsafe {
self.ifru_addr == other.ifru_addr
&& self.ifru_dstaddr == other.ifru_dstaddr
&& self.ifru_broadaddr == other.ifru_broadaddr
&& self.ifru_flags == other.ifru_flags
&& self.ifru_metrics == other.ifru_metrics
&& self.ifru_mtu == other.ifru_mtu
&& self.ifru_phys == other.ifru_phys
&& self.ifru_media == other.ifru_media
&& self.ifru_intval == other.ifru_intval
&& self.ifru_data == other.ifru_data
&& self.ifru_devmtu == other.ifru_devmtu
&& self.ifru_kpi == other.ifru_kpi
&& self.ifru_wake_flags == other.ifru_wake_flags
&& self.ifru_route_refcnt == other.ifru_route_refcnt
&& self.ifru_cap.iter().zip(other.ifru_cap.iter()).all(|(a,b)| a == b)
&& self.ifru_functional_type == other.ifru_functional_type
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifr_ifru {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifr_ifru {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__c_anonymous_ifr_ifru")
.field("ifru_addr", unsafe { &self.ifru_addr })
.field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
.field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
.field("ifru_flags", unsafe { &self.ifru_flags })
.field("ifru_metrics", unsafe { &self.ifru_metrics })
.field("ifru_mtu", unsafe { &self.ifru_mtu })
.field("ifru_phys", unsafe { &self.ifru_phys })
.field("ifru_media", unsafe { &self.ifru_media })
.field("ifru_intval", unsafe { &self.ifru_intval })
.field("ifru_data", unsafe { &self.ifru_data })
.field("ifru_devmtu", unsafe { &self.ifru_devmtu })
.field("ifru_kpi", unsafe { &self.ifru_kpi })
.field("ifru_wake_flags", unsafe { &self.ifru_wake_flags })
.field("ifru_route_refcnt", unsafe { &self.ifru_route_refcnt })
.field("ifru_cap", unsafe { &self.ifru_cap })
.field("ifru_functional_type", unsafe { &self.ifru_functional_type })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifr_ifru {
fn hash(&self, state: &mut H) {
unsafe {
self.ifru_addr.hash(state);
self.ifru_dstaddr.hash(state);
self.ifru_broadaddr.hash(state);
self.ifru_flags.hash(state);
self.ifru_metrics.hash(state);
self.ifru_mtu.hash(state);
self.ifru_phys.hash(state);
self.ifru_media.hash(state);
self.ifru_intval.hash(state);
self.ifru_data.hash(state);
self.ifru_devmtu.hash(state);
self.ifru_kpi.hash(state);
self.ifru_wake_flags.hash(state);
self.ifru_route_refcnt.hash(state);
self.ifru_cap.hash(state);
self.ifru_functional_type.hash(state);
}
}
}
impl PartialEq for ifreq {
fn eq(&self, other: &ifreq) -> bool {
self.ifr_name == other.ifr_name
&& self.ifr_ifru == other.ifr_ifru
}
}
impl Eq for ifreq {}
impl ::fmt::Debug for ifreq {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifreq")
.field("ifr_name", &self.ifr_name)
.field("ifr_ifru", &self.ifr_ifru)
.finish()
}
}
impl ::hash::Hash for ifreq {
fn hash(&self, state: &mut H) {
self.ifr_name.hash(state);
self.ifr_ifru.hash(state);
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifc_ifcu {}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifc_ifcu {
fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
unsafe {
self.ifcu_buf == other.ifcu_buf &&
self.ifcu_req == other.ifcu_req
}
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifc_ifcu")
.field("ifcu_buf", unsafe { &self.ifcu_buf })
.field("ifcu_req", unsafe { &self.ifcu_req })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifc_ifcu {
fn hash(&self, state: &mut H) {
unsafe { self.ifcu_buf.hash(state) };
unsafe { self.ifcu_req.hash(state) };
}
}
}
}
pub const _UTX_USERSIZE: usize = 256;
pub const _UTX_LINESIZE: usize = 32;
pub const _UTX_IDSIZE: usize = 4;
pub const _UTX_HOSTSIZE: usize = 256;
pub const EMPTY: ::c_short = 0;
pub const RUN_LVL: ::c_short = 1;
pub const BOOT_TIME: ::c_short = 2;
pub const OLD_TIME: ::c_short = 3;
pub const NEW_TIME: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const USER_PROCESS: ::c_short = 7;
pub const DEAD_PROCESS: ::c_short = 8;
pub const ACCOUNTING: ::c_short = 9;
pub const SIGNATURE: ::c_short = 10;
pub const SHUTDOWN_TIME: ::c_short = 11;
pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
pub const LC_MESSAGES_MASK: ::c_int = 1 << 2;
pub const LC_MONETARY_MASK: ::c_int = 1 << 3;
pub const LC_NUMERIC_MASK: ::c_int = 1 << 4;
pub const LC_TIME_MASK: ::c_int = 1 << 5;
pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
| LC_CTYPE_MASK
| LC_MESSAGES_MASK
| LC_MONETARY_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK;
pub const CODESET: ::nl_item = 0;
pub const D_T_FMT: ::nl_item = 1;
pub const D_FMT: ::nl_item = 2;
pub const T_FMT: ::nl_item = 3;
pub const T_FMT_AMPM: ::nl_item = 4;
pub const AM_STR: ::nl_item = 5;
pub const PM_STR: ::nl_item = 6;
pub const DAY_1: ::nl_item = 7;
pub const DAY_2: ::nl_item = 8;
pub const DAY_3: ::nl_item = 9;
pub const DAY_4: ::nl_item = 10;
pub const DAY_5: ::nl_item = 11;
pub const DAY_6: ::nl_item = 12;
pub const DAY_7: ::nl_item = 13;
pub const ABDAY_1: ::nl_item = 14;
pub const ABDAY_2: ::nl_item = 15;
pub const ABDAY_3: ::nl_item = 16;
pub const ABDAY_4: ::nl_item = 17;
pub const ABDAY_5: ::nl_item = 18;
pub const ABDAY_6: ::nl_item = 19;
pub const ABDAY_7: ::nl_item = 20;
pub const MON_1: ::nl_item = 21;
pub const MON_2: ::nl_item = 22;
pub const MON_3: ::nl_item = 23;
pub const MON_4: ::nl_item = 24;
pub const MON_5: ::nl_item = 25;
pub const MON_6: ::nl_item = 26;
pub const MON_7: ::nl_item = 27;
pub const MON_8: ::nl_item = 28;
pub const MON_9: ::nl_item = 29;
pub const MON_10: ::nl_item = 30;
pub const MON_11: ::nl_item = 31;
pub const MON_12: ::nl_item = 32;
pub const ABMON_1: ::nl_item = 33;
pub const ABMON_2: ::nl_item = 34;
pub const ABMON_3: ::nl_item = 35;
pub const ABMON_4: ::nl_item = 36;
pub const ABMON_5: ::nl_item = 37;
pub const ABMON_6: ::nl_item = 38;
pub const ABMON_7: ::nl_item = 39;
pub const ABMON_8: ::nl_item = 40;
pub const ABMON_9: ::nl_item = 41;
pub const ABMON_10: ::nl_item = 42;
pub const ABMON_11: ::nl_item = 43;
pub const ABMON_12: ::nl_item = 44;
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_MONOTONIC_RAW: ::clockid_t = 4;
pub const CLOCK_MONOTONIC_RAW_APPROX: ::clockid_t = 5;
pub const CLOCK_MONOTONIC: ::clockid_t = 6;
pub const CLOCK_UPTIME_RAW: ::clockid_t = 8;
pub const CLOCK_UPTIME_RAW_APPROX: ::clockid_t = 9;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 12;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 16;
pub const ERA: ::nl_item = 45;
pub const ERA_D_FMT: ::nl_item = 46;
pub const ERA_D_T_FMT: ::nl_item = 47;
pub const ERA_T_FMT: ::nl_item = 48;
pub const ALT_DIGITS: ::nl_item = 49;
pub const RADIXCHAR: ::nl_item = 50;
pub const THOUSEP: ::nl_item = 51;
pub const YESEXPR: ::nl_item = 52;
pub const NOEXPR: ::nl_item = 53;
pub const YESSTR: ::nl_item = 54;
pub const NOSTR: ::nl_item = 55;
pub const CRNCYSTR: ::nl_item = 56;
pub const D_MD_ORDER: ::nl_item = 57;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const RAND_MAX: ::c_int = 2147483647;
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const SEEK_HOLE: ::c_int = 3;
pub const SEEK_DATA: ::c_int = 4;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
pub const BUFSIZ: ::c_uint = 1024;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 1024;
pub const TMP_MAX: ::c_uint = 308915776;
pub const _PC_LINK_MAX: ::c_int = 1;
pub const _PC_MAX_CANON: ::c_int = 2;
pub const _PC_MAX_INPUT: ::c_int = 3;
pub const _PC_NAME_MAX: ::c_int = 4;
pub const _PC_PATH_MAX: ::c_int = 5;
pub const _PC_PIPE_BUF: ::c_int = 6;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
pub const _PC_NO_TRUNC: ::c_int = 8;
pub const _PC_VDISABLE: ::c_int = 9;
pub const O_EVTONLY: ::c_int = 0x00008000;
pub const O_NOCTTY: ::c_int = 0x00020000;
pub const O_DIRECTORY: ::c_int = 0x00100000;
pub const O_SYMLINK: ::c_int = 0x00200000;
pub const O_DSYNC: ::c_int = 0x00400000;
pub const O_CLOEXEC: ::c_int = 0x01000000;
pub const O_NOFOLLOW_ANY: ::c_int = 0x20000000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
pub const S_IFDIR: mode_t = 16384;
pub const S_IFREG: mode_t = 32768;
pub const S_IFLNK: mode_t = 40960;
pub const S_IFSOCK: mode_t = 49152;
pub const S_IFMT: mode_t = 61440;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const S_IRWXU: mode_t = 448;
pub const S_IXUSR: mode_t = 64;
pub const S_IWUSR: mode_t = 128;
pub const S_IRUSR: mode_t = 256;
pub const S_IRWXG: mode_t = 56;
pub const S_IXGRP: mode_t = 8;
pub const S_IWGRP: mode_t = 16;
pub const S_IRGRP: mode_t = 32;
pub const S_IRWXO: mode_t = 7;
pub const S_IXOTH: mode_t = 1;
pub const S_IWOTH: mode_t = 2;
pub const S_IROTH: mode_t = 4;
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGEMT: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const PT_TRACE_ME: ::c_int = 0;
pub const PT_READ_I: ::c_int = 1;
pub const PT_READ_D: ::c_int = 2;
pub const PT_READ_U: ::c_int = 3;
pub const PT_WRITE_I: ::c_int = 4;
pub const PT_WRITE_D: ::c_int = 5;
pub const PT_WRITE_U: ::c_int = 6;
pub const PT_CONTINUE: ::c_int = 7;
pub const PT_KILL: ::c_int = 8;
pub const PT_STEP: ::c_int = 9;
pub const PT_ATTACH: ::c_int = 10;
pub const PT_DETACH: ::c_int = 11;
pub const PT_SIGEXC: ::c_int = 12;
pub const PT_THUPDATE: ::c_int = 13;
pub const PT_ATTACHEXC: ::c_int = 14;
pub const PT_FORCEQUOTA: ::c_int = 30;
pub const PT_DENY_ATTACH: ::c_int = 31;
pub const PT_FIRSTMACH: ::c_int = 32;
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const CPU_STATE_USER: ::c_int = 0;
pub const CPU_STATE_SYSTEM: ::c_int = 1;
pub const CPU_STATE_IDLE: ::c_int = 2;
pub const CPU_STATE_NICE: ::c_int = 3;
pub const CPU_STATE_MAX: ::c_int = 4;
pub const PROCESSOR_BASIC_INFO: ::c_int = 1;
pub const PROCESSOR_CPU_LOAD_INFO: ::c_int = 2;
pub const PROCESSOR_PM_REGS_INFO: ::c_int = 0x10000001;
pub const PROCESSOR_TEMPERATURE: ::c_int = 0x10000002;
pub const PROCESSOR_SET_LOAD_INFO: ::c_int = 4;
pub const PROCESSOR_SET_BASIC_INFO: ::c_int = 5;
deprecated_mach! {
pub const VM_FLAGS_FIXED: ::c_int = 0x0000;
pub const VM_FLAGS_ANYWHERE: ::c_int = 0x0001;
pub const VM_FLAGS_PURGABLE: ::c_int = 0x0002;
pub const VM_FLAGS_RANDOM_ADDR: ::c_int = 0x0008;
pub const VM_FLAGS_NO_CACHE: ::c_int = 0x0010;
pub const VM_FLAGS_RESILIENT_CODESIGN: ::c_int = 0x0020;
pub const VM_FLAGS_RESILIENT_MEDIA: ::c_int = 0x0040;
pub const VM_FLAGS_OVERWRITE: ::c_int = 0x4000;
pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000;
pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000;
pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000;
pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000;
pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401f;
pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401f;
pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED |
VM_FLAGS_ANYWHERE |
VM_FLAGS_RANDOM_ADDR |
VM_FLAGS_OVERWRITE |
VM_FLAGS_RETURN_DATA_ADDR |
VM_FLAGS_RESILIENT_CODESIGN;
pub const VM_FLAGS_SUPERPAGE_SHIFT: ::c_int = 16;
pub const SUPERPAGE_NONE: ::c_int = 0;
pub const SUPERPAGE_SIZE_ANY: ::c_int = 1;
pub const VM_FLAGS_SUPERPAGE_NONE: ::c_int = SUPERPAGE_NONE <<
VM_FLAGS_SUPERPAGE_SHIFT;
pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: ::c_int = SUPERPAGE_SIZE_ANY <<
VM_FLAGS_SUPERPAGE_SHIFT;
pub const SUPERPAGE_SIZE_2MB: ::c_int = 2;
pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: ::c_int = SUPERPAGE_SIZE_2MB <<
VM_FLAGS_SUPERPAGE_SHIFT;
pub const VM_MEMORY_MALLOC: ::c_int = 1;
pub const VM_MEMORY_MALLOC_SMALL: ::c_int = 2;
pub const VM_MEMORY_MALLOC_LARGE: ::c_int = 3;
pub const VM_MEMORY_MALLOC_HUGE: ::c_int = 4;
pub const VM_MEMORY_SBRK: ::c_int = 5;
pub const VM_MEMORY_REALLOC: ::c_int = 6;
pub const VM_MEMORY_MALLOC_TINY: ::c_int = 7;
pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: ::c_int = 8;
pub const VM_MEMORY_MALLOC_LARGE_REUSED: ::c_int = 9;
pub const VM_MEMORY_ANALYSIS_TOOL: ::c_int = 10;
pub const VM_MEMORY_MALLOC_NANO: ::c_int = 11;
pub const VM_MEMORY_MACH_MSG: ::c_int = 20;
pub const VM_MEMORY_IOKIT: ::c_int = 21;
pub const VM_MEMORY_STACK: ::c_int = 30;
pub const VM_MEMORY_GUARD: ::c_int = 31;
pub const VM_MEMORY_SHARED_PMAP: ::c_int = 32;
pub const VM_MEMORY_DYLIB: ::c_int = 33;
pub const VM_MEMORY_OBJC_DISPATCHERS: ::c_int = 34;
pub const VM_MEMORY_UNSHARED_PMAP: ::c_int = 35;
pub const VM_MEMORY_APPKIT: ::c_int = 40;
pub const VM_MEMORY_FOUNDATION: ::c_int = 41;
pub const VM_MEMORY_COREGRAPHICS: ::c_int = 42;
pub const VM_MEMORY_CORESERVICES: ::c_int = 43;
pub const VM_MEMORY_CARBON: ::c_int = VM_MEMORY_CORESERVICES;
pub const VM_MEMORY_JAVA: ::c_int = 44;
pub const VM_MEMORY_COREDATA: ::c_int = 45;
pub const VM_MEMORY_COREDATA_OBJECTIDS: ::c_int = 46;
pub const VM_MEMORY_ATS: ::c_int = 50;
pub const VM_MEMORY_LAYERKIT: ::c_int = 51;
pub const VM_MEMORY_CGIMAGE: ::c_int = 52;
pub const VM_MEMORY_TCMALLOC: ::c_int = 53;
pub const VM_MEMORY_COREGRAPHICS_DATA: ::c_int = 54;
pub const VM_MEMORY_COREGRAPHICS_SHARED: ::c_int = 55;
pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: ::c_int = 56;
pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: ::c_int = 57;
pub const VM_MEMORY_COREGRAPHICS_XALLOC: ::c_int = 58;
pub const VM_MEMORY_COREGRAPHICS_MISC: ::c_int = VM_MEMORY_COREGRAPHICS;
pub const VM_MEMORY_DYLD: ::c_int = 60;
pub const VM_MEMORY_DYLD_MALLOC: ::c_int = 61;
pub const VM_MEMORY_SQLITE: ::c_int = 62;
pub const VM_MEMORY_JAVASCRIPT_CORE: ::c_int = 63;
pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: ::c_int = 64;
pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: ::c_int = 65;
pub const VM_MEMORY_GLSL: ::c_int = 66;
pub const VM_MEMORY_OPENCL: ::c_int = 67;
pub const VM_MEMORY_COREIMAGE: ::c_int = 68;
pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: ::c_int = 69;
pub const VM_MEMORY_IMAGEIO: ::c_int = 70;
pub const VM_MEMORY_COREPROFILE: ::c_int = 71;
pub const VM_MEMORY_ASSETSD: ::c_int = 72;
pub const VM_MEMORY_OS_ALLOC_ONCE: ::c_int = 73;
pub const VM_MEMORY_LIBDISPATCH: ::c_int = 74;
pub const VM_MEMORY_ACCELERATE: ::c_int = 75;
pub const VM_MEMORY_COREUI: ::c_int = 76;
pub const VM_MEMORY_COREUIFILE: ::c_int = 77;
pub const VM_MEMORY_GENEALOGY: ::c_int = 78;
pub const VM_MEMORY_RAWCAMERA: ::c_int = 79;
pub const VM_MEMORY_CORPSEINFO: ::c_int = 80;
pub const VM_MEMORY_ASL: ::c_int = 81;
pub const VM_MEMORY_SWIFT_RUNTIME: ::c_int = 82;
pub const VM_MEMORY_SWIFT_METADATA: ::c_int = 83;
pub const VM_MEMORY_DHMM: ::c_int = 84;
pub const VM_MEMORY_SCENEKIT: ::c_int = 86;
pub const VM_MEMORY_SKYWALK: ::c_int = 87;
pub const VM_MEMORY_APPLICATION_SPECIFIC_1: ::c_int = 240;
pub const VM_MEMORY_APPLICATION_SPECIFIC_16: ::c_int = 255;
}
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
pub const MS_SYNC: ::c_int = 0x0010;
pub const MS_KILLPAGES: ::c_int = 0x0004;
pub const MS_DEACTIVATE: ::c_int = 0x0008;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EDEADLK: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const EAGAIN: ::c_int = 35;
pub const EWOULDBLOCK: ::c_int = EAGAIN;
pub const EINPROGRESS: ::c_int = 36;
pub const EALREADY: ::c_int = 37;
pub const ENOTSOCK: ::c_int = 38;
pub const EDESTADDRREQ: ::c_int = 39;
pub const EMSGSIZE: ::c_int = 40;
pub const EPROTOTYPE: ::c_int = 41;
pub const ENOPROTOOPT: ::c_int = 42;
pub const EPROTONOSUPPORT: ::c_int = 43;
pub const ESOCKTNOSUPPORT: ::c_int = 44;
pub const ENOTSUP: ::c_int = 45;
pub const EPFNOSUPPORT: ::c_int = 46;
pub const EAFNOSUPPORT: ::c_int = 47;
pub const EADDRINUSE: ::c_int = 48;
pub const EADDRNOTAVAIL: ::c_int = 49;
pub const ENETDOWN: ::c_int = 50;
pub const ENETUNREACH: ::c_int = 51;
pub const ENETRESET: ::c_int = 52;
pub const ECONNABORTED: ::c_int = 53;
pub const ECONNRESET: ::c_int = 54;
pub const ENOBUFS: ::c_int = 55;
pub const EISCONN: ::c_int = 56;
pub const ENOTCONN: ::c_int = 57;
pub const ESHUTDOWN: ::c_int = 58;
pub const ETOOMANYREFS: ::c_int = 59;
pub const ETIMEDOUT: ::c_int = 60;
pub const ECONNREFUSED: ::c_int = 61;
pub const ELOOP: ::c_int = 62;
pub const ENAMETOOLONG: ::c_int = 63;
pub const EHOSTDOWN: ::c_int = 64;
pub const EHOSTUNREACH: ::c_int = 65;
pub const ENOTEMPTY: ::c_int = 66;
pub const EPROCLIM: ::c_int = 67;
pub const EUSERS: ::c_int = 68;
pub const EDQUOT: ::c_int = 69;
pub const ESTALE: ::c_int = 70;
pub const EREMOTE: ::c_int = 71;
pub const EBADRPC: ::c_int = 72;
pub const ERPCMISMATCH: ::c_int = 73;
pub const EPROGUNAVAIL: ::c_int = 74;
pub const EPROGMISMATCH: ::c_int = 75;
pub const EPROCUNAVAIL: ::c_int = 76;
pub const ENOLCK: ::c_int = 77;
pub const ENOSYS: ::c_int = 78;
pub const EFTYPE: ::c_int = 79;
pub const EAUTH: ::c_int = 80;
pub const ENEEDAUTH: ::c_int = 81;
pub const EPWROFF: ::c_int = 82;
pub const EDEVERR: ::c_int = 83;
pub const EOVERFLOW: ::c_int = 84;
pub const EBADEXEC: ::c_int = 85;
pub const EBADARCH: ::c_int = 86;
pub const ESHLIBVERS: ::c_int = 87;
pub const EBADMACHO: ::c_int = 88;
pub const ECANCELED: ::c_int = 89;
pub const EIDRM: ::c_int = 90;
pub const ENOMSG: ::c_int = 91;
pub const EILSEQ: ::c_int = 92;
pub const ENOATTR: ::c_int = 93;
pub const EBADMSG: ::c_int = 94;
pub const EMULTIHOP: ::c_int = 95;
pub const ENODATA: ::c_int = 96;
pub const ENOLINK: ::c_int = 97;
pub const ENOSR: ::c_int = 98;
pub const ENOSTR: ::c_int = 99;
pub const EPROTO: ::c_int = 100;
pub const ETIME: ::c_int = 101;
pub const EOPNOTSUPP: ::c_int = 102;
pub const ENOPOLICY: ::c_int = 103;
pub const ENOTRECOVERABLE: ::c_int = 104;
pub const EOWNERDEAD: ::c_int = 105;
pub const EQFULL: ::c_int = 106;
pub const ELAST: ::c_int = 106;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
pub const EAI_FAMILY: ::c_int = 5;
pub const EAI_MEMORY: ::c_int = 6;
pub const EAI_NODATA: ::c_int = 7;
pub const EAI_NONAME: ::c_int = 8;
pub const EAI_SERVICE: ::c_int = 9;
pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
pub const EAI_OVERFLOW: ::c_int = 14;
pub const F_DUPFD: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 67;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const F_PREALLOCATE: ::c_int = 42;
pub const F_RDADVISE: ::c_int = 44;
pub const F_RDAHEAD: ::c_int = 45;
pub const F_NOCACHE: ::c_int = 48;
pub const F_LOG2PHYS: ::c_int = 49;
pub const F_GETPATH: ::c_int = 50;
pub const F_FULLFSYNC: ::c_int = 51;
pub const F_FREEZE_FS: ::c_int = 53;
pub const F_THAW_FS: ::c_int = 54;
pub const F_GLOBAL_NOCACHE: ::c_int = 55;
pub const F_NODIRECT: ::c_int = 62;
pub const F_LOG2PHYS_EXT: ::c_int = 65;
pub const F_BARRIERFSYNC: ::c_int = 85;
pub const F_PUNCHHOLE: ::c_int = 99;
pub const F_TRIM_ACTIVE_FILE: ::c_int = 100;
pub const F_SPECULATIVE_READ: ::c_int = 101;
pub const F_GETPATH_NOFIRMLINK: ::c_int = 102;
pub const F_ALLOCATECONTIG: ::c_uint = 0x02;
pub const F_ALLOCATEALL: ::c_uint = 0x04;
pub const F_PEOFPOSMODE: ::c_int = 3;
pub const F_VOLPOSMODE: ::c_int = 4;
pub const AT_FDCWD: ::c_int = -2;
pub const AT_EACCESS: ::c_int = 0x0010;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x0040;
pub const AT_REMOVEDIR: ::c_int = 0x0080;
pub const PTHREAD_INTROSPECTION_THREAD_CREATE: ::c_uint = 1;
pub const PTHREAD_INTROSPECTION_THREAD_START: ::c_uint = 2;
pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: ::c_uint = 3;
pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: ::c_uint = 4;
pub const TIOCMODG: ::c_ulong = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCM_LE: ::c_int = 0x1;
pub const TIOCM_DTR: ::c_int = 0x2;
pub const TIOCM_RTS: ::c_int = 0x4;
pub const TIOCM_ST: ::c_int = 0x8;
pub const TIOCM_SR: ::c_int = 0x10;
pub const TIOCM_CTS: ::c_int = 0x20;
pub const TIOCM_CAR: ::c_int = 0x40;
pub const TIOCM_CD: ::c_int = 0x40;
pub const TIOCM_RNG: ::c_int = 0x80;
pub const TIOCM_RI: ::c_int = 0x80;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCEXCL: ::c_int = 0x2000740d;
pub const TIOCNXCL: ::c_int = 0x2000740e;
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
pub const TIOCIXON: ::c_uint = 0x20007481;
pub const TIOCIXOFF: ::c_uint = 0x20007480;
pub const TIOCSDTR: ::c_uint = 0x20007479;
pub const TIOCCDTR: ::c_uint = 0x20007478;
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCSTI: ::c_ulong = 0x80017472;
pub const TIOCNOTTY: ::c_uint = 0x20007471;
pub const TIOCPKT: ::c_ulong = 0x80047470;
pub const TIOCPKT_DATA: ::c_int = 0x0;
pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
pub const TIOCPKT_STOP: ::c_int = 0x4;
pub const TIOCPKT_START: ::c_int = 0x8;
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
pub const TIOCPKT_IOCTL: ::c_int = 0x40;
pub const TIOCSTOP: ::c_uint = 0x2000746f;
pub const TIOCSTART: ::c_uint = 0x2000746e;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const TIOCUCNTL: ::c_ulong = 0x80047466;
pub const TIOCSTAT: ::c_uint = 0x20007465;
pub const TIOCSCONS: ::c_uint = 0x20007463;
pub const TIOCCONS: ::c_ulong = 0x80047462;
pub const TIOCSCTTY: ::c_uint = 0x20007461;
pub const TIOCEXT: ::c_ulong = 0x80047460;
pub const TIOCSIG: ::c_uint = 0x2000745f;
pub const TIOCDRAIN: ::c_uint = 0x2000745e;
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
pub const TIOCDSIMICROCODE: ::c_uint = 0x20007455;
pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
pub const BIOCGRSIG: ::c_ulong = 0x40044272;
pub const BIOCSRSIG: ::c_ulong = 0x80044273;
pub const BIOCSDLT: ::c_ulong = 0x80044278;
pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279;
pub const FIODTYPE: ::c_ulong = 0x4004667a;
pub const B0: speed_t = 0;
pub const B50: speed_t = 50;
pub const B75: speed_t = 75;
pub const B110: speed_t = 110;
pub const B134: speed_t = 134;
pub const B150: speed_t = 150;
pub const B200: speed_t = 200;
pub const B300: speed_t = 300;
pub const B600: speed_t = 600;
pub const B1200: speed_t = 1200;
pub const B1800: speed_t = 1800;
pub const B2400: speed_t = 2400;
pub const B4800: speed_t = 4800;
pub const B9600: speed_t = 9600;
pub const B19200: speed_t = 19200;
pub const B38400: speed_t = 38400;
pub const B7200: speed_t = 7200;
pub const B14400: speed_t = 14400;
pub const B28800: speed_t = 28800;
pub const B57600: speed_t = 57600;
pub const B76800: speed_t = 76800;
pub const B115200: speed_t = 115200;
pub const B230400: speed_t = 230400;
pub const EXTA: speed_t = 19200;
pub const EXTB: speed_t = 38400;
pub const SIGTRAP: ::c_int = 5;
pub const GLOB_APPEND: ::c_int = 0x0001;
pub const GLOB_DOOFFS: ::c_int = 0x0002;
pub const GLOB_ERR: ::c_int = 0x0004;
pub const GLOB_MARK: ::c_int = 0x0008;
pub const GLOB_NOCHECK: ::c_int = 0x0010;
pub const GLOB_NOSORT: ::c_int = 0x0020;
pub const GLOB_NOESCAPE: ::c_int = 0x2000;
pub const GLOB_NOSPACE: ::c_int = -1;
pub const GLOB_ABORTED: ::c_int = -2;
pub const GLOB_NOMATCH: ::c_int = -3;
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const _SC_IOV_MAX: ::c_int = 56;
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
pub const _SC_THREADS: ::c_int = 96;
pub const _SC_TTY_NAME_MAX: ::c_int = 101;
pub const _SC_ATEXIT_MAX: ::c_int = 107;
pub const _SC_XOPEN_CRYPT: ::c_int = 108;
pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
pub const _SC_XOPEN_LEGACY: ::c_int = 110;
pub const _SC_XOPEN_REALTIME: ::c_int = 111;
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
pub const _SC_XOPEN_SHM: ::c_int = 113;
pub const _SC_XOPEN_UNIX: ::c_int = 115;
pub const _SC_XOPEN_VERSION: ::c_int = 116;
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 121;
pub const _SC_PHYS_PAGES: ::c_int = 200;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 2;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 1;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 2;
#[cfg(target_arch = "aarch64")]
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
#[cfg(not(target_arch = "aarch64"))]
pub const PTHREAD_STACK_MIN: ::size_t = 8192;
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_AS: ::c_int = 5;
pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
pub const RLIMIT_MEMLOCK: ::c_int = 6;
pub const RLIMIT_NPROC: ::c_int = 7;
pub const RLIMIT_NOFILE: ::c_int = 8;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 9;
pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
pub const RUSAGE_SELF: ::c_int = 0;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 5;
pub const MADV_ZERO_WIRED_PAGES: ::c_int = 6;
pub const MADV_FREE_REUSABLE: ::c_int = 7;
pub const MADV_FREE_REUSE: ::c_int = 8;
pub const MADV_CAN_REUSE: ::c_int = 9;
pub const MINCORE_INCORE: ::c_int = 0x1;
pub const MINCORE_REFERENCED: ::c_int = 0x2;
pub const MINCORE_MODIFIED: ::c_int = 0x4;
pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
pub const CTLIOCGINFO: c_ulong = 0xc0644e03;
//
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// IP6 hop-by-hop options
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// gateway2 (deprecated)
pub const IPPROTO_GGP: ::c_int = 3;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// Stream protocol II.
pub const IPPROTO_ST: ::c_int = 7;
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// private interior gateway
pub const IPPROTO_PIGP: ::c_int = 9;
/// BBN RCC Monitoring
pub const IPPROTO_RCCMON: ::c_int = 10;
/// network voice protocol
pub const IPPROTO_NVPII: ::c_int = 11;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
/// Argus
pub const IPPROTO_ARGUS: ::c_int = 13;
/// EMCON
pub const IPPROTO_EMCON: ::c_int = 14;
/// Cross Net Debugger
pub const IPPROTO_XNET: ::c_int = 15;
/// Chaos
pub const IPPROTO_CHAOS: ::c_int = 16;
// IPPROTO_UDP defined in src/unix/mod.rs
/// Multiplexing
pub const IPPROTO_MUX: ::c_int = 18;
/// DCN Measurement Subsystems
pub const IPPROTO_MEAS: ::c_int = 19;
/// Host Monitoring
pub const IPPROTO_HMP: ::c_int = 20;
/// Packet Radio Measurement
pub const IPPROTO_PRM: ::c_int = 21;
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// Trunk-1
pub const IPPROTO_TRUNK1: ::c_int = 23;
/// Trunk-2
pub const IPPROTO_TRUNK2: ::c_int = 24;
/// Leaf-1
pub const IPPROTO_LEAF1: ::c_int = 25;
/// Leaf-2
pub const IPPROTO_LEAF2: ::c_int = 26;
/// Reliable Data
pub const IPPROTO_RDP: ::c_int = 27;
/// Reliable Transaction
pub const IPPROTO_IRTP: ::c_int = 28;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// Bulk Data Transfer
pub const IPPROTO_BLT: ::c_int = 30;
/// Network Services
pub const IPPROTO_NSP: ::c_int = 31;
/// Merit Internodal
pub const IPPROTO_INP: ::c_int = 32;
/// Sequential Exchange
pub const IPPROTO_SEP: ::c_int = 33;
/// Third Party Connect
pub const IPPROTO_3PC: ::c_int = 34;
/// InterDomain Policy Routing
pub const IPPROTO_IDPR: ::c_int = 35;
/// XTP
pub const IPPROTO_XTP: ::c_int = 36;
/// Datagram Delivery
pub const IPPROTO_DDP: ::c_int = 37;
/// Control Message Transport
pub const IPPROTO_CMTP: ::c_int = 38;
/// TP++ Transport
pub const IPPROTO_TPXX: ::c_int = 39;
/// IL transport protocol
pub const IPPROTO_IL: ::c_int = 40;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// Source Demand Routing
pub const IPPROTO_SDRP: ::c_int = 42;
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// InterDomain Routing
pub const IPPROTO_IDRP: ::c_int = 45;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// Mobile Host Routing
pub const IPPROTO_MHRP: ::c_int = 48;
/// BHA
pub const IPPROTO_BHA: ::c_int = 49;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
/// Integ. Net Layer Security
pub const IPPROTO_INLSP: ::c_int = 52;
/// IP with encryption
pub const IPPROTO_SWIPE: ::c_int = 53;
/// Next Hop Resolution
pub const IPPROTO_NHRP: ::c_int = 54;
/* 55-57: Unassigned */
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
/// any host internal protocol
pub const IPPROTO_AHIP: ::c_int = 61;
/// CFTP
pub const IPPROTO_CFTP: ::c_int = 62;
/// "hello" routing protocol
pub const IPPROTO_HELLO: ::c_int = 63;
/// SATNET/Backroom EXPAK
pub const IPPROTO_SATEXPAK: ::c_int = 64;
/// Kryptolan
pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
/// Remote Virtual Disk
pub const IPPROTO_RVD: ::c_int = 66;
/// Pluribus Packet Core
pub const IPPROTO_IPPC: ::c_int = 67;
/// Any distributed FS
pub const IPPROTO_ADFS: ::c_int = 68;
/// Satnet Monitoring
pub const IPPROTO_SATMON: ::c_int = 69;
/// VISA Protocol
pub const IPPROTO_VISA: ::c_int = 70;
/// Packet Core Utility
pub const IPPROTO_IPCV: ::c_int = 71;
/// Comp. Prot. Net. Executive
pub const IPPROTO_CPNX: ::c_int = 72;
/// Comp. Prot. HeartBeat
pub const IPPROTO_CPHB: ::c_int = 73;
/// Wang Span Network
pub const IPPROTO_WSN: ::c_int = 74;
/// Packet Video Protocol
pub const IPPROTO_PVP: ::c_int = 75;
/// BackRoom SATNET Monitoring
pub const IPPROTO_BRSATMON: ::c_int = 76;
/// Sun net disk proto (temp.)
pub const IPPROTO_ND: ::c_int = 77;
/// WIDEBAND Monitoring
pub const IPPROTO_WBMON: ::c_int = 78;
/// WIDEBAND EXPAK
pub const IPPROTO_WBEXPAK: ::c_int = 79;
/// ISO cnlp
pub const IPPROTO_EON: ::c_int = 80;
/// VMTP
pub const IPPROTO_VMTP: ::c_int = 81;
/// Secure VMTP
pub const IPPROTO_SVMTP: ::c_int = 82;
/// Banyon VINES
pub const IPPROTO_VINES: ::c_int = 83;
/// TTP
pub const IPPROTO_TTP: ::c_int = 84;
/// NSFNET-IGP
pub const IPPROTO_IGP: ::c_int = 85;
/// dissimilar gateway prot.
pub const IPPROTO_DGP: ::c_int = 86;
/// TCF
pub const IPPROTO_TCF: ::c_int = 87;
/// Cisco/GXS IGRP
pub const IPPROTO_IGRP: ::c_int = 88;
/// OSPFIGP
pub const IPPROTO_OSPFIGP: ::c_int = 89;
/// Strite RPC protocol
pub const IPPROTO_SRPC: ::c_int = 90;
/// Locus Address Resoloution
pub const IPPROTO_LARP: ::c_int = 91;
/// Multicast Transport
pub const IPPROTO_MTP: ::c_int = 92;
/// AX.25 Frames
pub const IPPROTO_AX25: ::c_int = 93;
/// IP encapsulated in IP
pub const IPPROTO_IPEIP: ::c_int = 94;
/// Mobile Int.ing control
pub const IPPROTO_MICP: ::c_int = 95;
/// Semaphore Comm. security
pub const IPPROTO_SCCSP: ::c_int = 96;
/// Ethernet IP encapsulation
pub const IPPROTO_ETHERIP: ::c_int = 97;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// any private encr. scheme
pub const IPPROTO_APES: ::c_int = 99;
/// GMTP
pub const IPPROTO_GMTP: ::c_int = 100;
/* 101-254: Partly Unassigned */
/// Protocol Independent Mcast
pub const IPPROTO_PIM: ::c_int = 103;
/// payload compression (IPComp)
pub const IPPROTO_IPCOMP: ::c_int = 108;
/// PGM
pub const IPPROTO_PGM: ::c_int = 113;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
/* 255: Reserved */
/* BSD Private, local use, namespace incursion */
/// divert pseudo-protocol
pub const IPPROTO_DIVERT: ::c_int = 254;
/// raw IP packet
pub const IPPROTO_RAW: ::c_int = 255;
pub const IPPROTO_MAX: ::c_int = 256;
/// last return value of *_input(), meaning "all job for this pkt is done".
pub const IPPROTO_DONE: ::c_int = 257;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_INET: ::c_int = 2;
pub const AF_IMPLINK: ::c_int = 3;
pub const AF_PUP: ::c_int = 4;
pub const AF_CHAOS: ::c_int = 5;
pub const AF_NS: ::c_int = 6;
pub const AF_ISO: ::c_int = 7;
pub const AF_OSI: ::c_int = AF_ISO;
pub const AF_ECMA: ::c_int = 8;
pub const AF_DATAKIT: ::c_int = 9;
pub const AF_CCITT: ::c_int = 10;
pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_LINK: ::c_int = 18;
pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_COIP: ::c_int = 20;
pub const AF_CNT: ::c_int = 21;
pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_SIP: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
pub const AF_NDRV: ::c_int = 27;
pub const AF_ISDN: ::c_int = 28;
pub const AF_E164: ::c_int = AF_ISDN;
pub const pseudo_AF_KEY: ::c_int = 29;
pub const AF_INET6: ::c_int = 30;
pub const AF_NATM: ::c_int = 31;
pub const AF_SYSTEM: ::c_int = 32;
pub const AF_NETBIOS: ::c_int = 33;
pub const AF_PPP: ::c_int = 34;
pub const pseudo_AF_HDRCMPLT: ::c_int = 35;
pub const AF_IEEE80211: ::c_int = 37;
pub const AF_UTUN: ::c_int = 38;
pub const AF_VSOCK: ::c_int = 40;
pub const AF_SYS_CONTROL: ::c_int = 2;
pub const SYSPROTO_EVENT: ::c_int = 1;
pub const SYSPROTO_CONTROL: ::c_int = 2;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_LOCAL: ::c_int = AF_LOCAL;
pub const PF_UNIX: ::c_int = PF_LOCAL;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
pub const PF_PUP: ::c_int = AF_PUP;
pub const PF_CHAOS: ::c_int = AF_CHAOS;
pub const PF_NS: ::c_int = AF_NS;
pub const PF_ISO: ::c_int = AF_ISO;
pub const PF_OSI: ::c_int = AF_ISO;
pub const PF_ECMA: ::c_int = AF_ECMA;
pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
pub const PF_CCITT: ::c_int = AF_CCITT;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_DLI: ::c_int = AF_DLI;
pub const PF_LAT: ::c_int = AF_LAT;
pub const PF_HYLINK: ::c_int = AF_HYLINK;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_ROUTE: ::c_int = AF_ROUTE;
pub const PF_LINK: ::c_int = AF_LINK;
pub const PF_XTP: ::c_int = pseudo_AF_XTP;
pub const PF_COIP: ::c_int = AF_COIP;
pub const PF_CNT: ::c_int = AF_CNT;
pub const PF_SIP: ::c_int = AF_SIP;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
pub const PF_NDRV: ::c_int = AF_NDRV;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_NATM: ::c_int = AF_NATM;
pub const PF_SYSTEM: ::c_int = AF_SYSTEM;
pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
pub const PF_PPP: ::c_int = AF_PPP;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
pub const NET_RT_IFLIST: ::c_int = 3;
pub const SOMAXCONN: ::c_int = 128;
pub const SOCK_MAXADDRLEN: ::c_int = 255;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const IP_TTL: ::c_int = 4;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IP_RECVIF: ::c_int = 20;
pub const IP_RECVTTL: ::c_int = 24;
pub const IP_BOUND_IF: ::c_int = 25;
pub const IP_PKTINFO: ::c_int = 26;
pub const IP_RECVTOS: ::c_int = 27;
pub const IP_DONTFRAG: ::c_int = 28;
pub const IPV6_JOIN_GROUP: ::c_int = 12;
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const IPV6_CHECKSUM: ::c_int = 26;
pub const IPV6_RECVTCLASS: ::c_int = 35;
pub const IPV6_TCLASS: ::c_int = 36;
pub const IPV6_RECVHOPLIMIT: ::c_int = 37;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVPKTINFO: ::c_int = 61;
pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
pub const IPV6_BOUND_IF: ::c_int = 125;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
pub const TCP_KEEPALIVE: ::c_int = 0x10;
pub const TCP_KEEPINTVL: ::c_int = 0x101;
pub const TCP_KEEPCNT: ::c_int = 0x102;
/// Enable/Disable TCP Fastopen on this socket
pub const TCP_FASTOPEN: ::c_int = 0x105;
pub const TCP_CONNECTION_INFO: ::c_int = 0x106;
pub const SOL_LOCAL: ::c_int = 0;
pub const LOCAL_PEERCRED: ::c_int = 0x001;
pub const LOCAL_PEERPID: ::c_int = 0x002;
pub const LOCAL_PEEREPID: ::c_int = 0x003;
pub const LOCAL_PEERUUID: ::c_int = 0x004;
pub const LOCAL_PEEREUUID: ::c_int = 0x005;
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_USELOOPBACK: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_TIMESTAMP: ::c_int = 0x0400;
pub const SO_TIMESTAMP_MONOTONIC: ::c_int = 0x0800;
pub const SO_DONTTRUNC: ::c_int = 0x2000;
pub const SO_WANTMORE: ::c_int = 0x4000;
pub const SO_WANTOOBFLAG: ::c_int = 0x8000;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SO_LABEL: ::c_int = 0x1010;
pub const SO_PEERLABEL: ::c_int = 0x1011;
pub const SO_NREAD: ::c_int = 0x1020;
pub const SO_NKE: ::c_int = 0x1021;
pub const SO_NOSIGPIPE: ::c_int = 0x1022;
pub const SO_NOADDRERR: ::c_int = 0x1023;
pub const SO_NWRITE: ::c_int = 0x1024;
pub const SO_REUSESHAREUID: ::c_int = 0x1025;
pub const SO_NOTIFYCONFLICT: ::c_int = 0x1026;
pub const SO_LINGER_SEC: ::c_int = 0x1080;
pub const SO_RANDOMPORT: ::c_int = 0x1082;
pub const SO_NP_EXTENSIONS: ::c_int = 0x1083;
pub const MSG_OOB: ::c_int = 0x1;
pub const MSG_PEEK: ::c_int = 0x2;
pub const MSG_DONTROUTE: ::c_int = 0x4;
pub const MSG_EOR: ::c_int = 0x8;
pub const MSG_TRUNC: ::c_int = 0x10;
pub const MSG_CTRUNC: ::c_int = 0x20;
pub const MSG_WAITALL: ::c_int = 0x40;
pub const MSG_DONTWAIT: ::c_int = 0x80;
pub const MSG_EOF: ::c_int = 0x100;
pub const MSG_FLUSH: ::c_int = 0x400;
pub const MSG_HOLD: ::c_int = 0x800;
pub const MSG_SEND: ::c_int = 0x1000;
pub const MSG_HAVEMORE: ::c_int = 0x2000;
pub const MSG_RCVMORE: ::c_int = 0x4000;
pub const MSG_NEEDSA: ::c_int = 0x10000;
pub const MSG_NOSIGNAL: ::c_int = 0x80000;
pub const SCM_TIMESTAMP: ::c_int = 0x02;
pub const SCM_CREDS: ::c_int = 0x03;
// https://github.com/aosm/xnu/blob/HEAD/bsd/net/if.h#L140-L156
pub const IFF_UP: ::c_int = 0x1; // interface is up
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
pub const IFF_NOTRAILERS: ::c_int = 0x20; // obsolete: avoid use of trailers
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
pub const SAE_ASSOCID_ANY: ::sae_associd_t = 0;
/// ((sae_associd_t)(-1ULL))
pub const SAE_ASSOCID_ALL: ::sae_associd_t = 0xffffffff;
pub const SAE_CONNID_ANY: ::sae_connid_t = 0;
/// ((sae_connid_t)(-1ULL))
pub const SAE_CONNID_ALL: ::sae_connid_t = 0xffffffff;
// connectx() flag parameters
/// resume connect() on read/write
pub const CONNECT_RESUME_ON_READ_WRITE: ::c_uint = 0x1;
/// data is idempotent
pub const CONNECT_DATA_IDEMPOTENT: ::c_uint = 0x2;
/// data includes security that replaces the TFO-cookie
pub const CONNECT_DATA_AUTHENTICATED: ::c_uint = 0x4;
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
pub const MAP_COPY: ::c_int = 0x0002;
pub const MAP_RENAME: ::c_int = 0x0020;
pub const MAP_NORESERVE: ::c_int = 0x0040;
pub const MAP_NOEXTEND: ::c_int = 0x0100;
pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
pub const MAP_NOCACHE: ::c_int = 0x0400;
pub const MAP_JIT: ::c_int = 0x0800;
pub const _SC_ARG_MAX: ::c_int = 1;
pub const _SC_CHILD_MAX: ::c_int = 2;
pub const _SC_CLK_TCK: ::c_int = 3;
pub const _SC_NGROUPS_MAX: ::c_int = 4;
pub const _SC_OPEN_MAX: ::c_int = 5;
pub const _SC_JOB_CONTROL: ::c_int = 6;
pub const _SC_SAVED_IDS: ::c_int = 7;
pub const _SC_VERSION: ::c_int = 8;
pub const _SC_BC_BASE_MAX: ::c_int = 9;
pub const _SC_BC_DIM_MAX: ::c_int = 10;
pub const _SC_BC_SCALE_MAX: ::c_int = 11;
pub const _SC_BC_STRING_MAX: ::c_int = 12;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
pub const _SC_LINE_MAX: ::c_int = 15;
pub const _SC_RE_DUP_MAX: ::c_int = 16;
pub const _SC_2_VERSION: ::c_int = 17;
pub const _SC_2_C_BIND: ::c_int = 18;
pub const _SC_2_C_DEV: ::c_int = 19;
pub const _SC_2_CHAR_TERM: ::c_int = 20;
pub const _SC_2_FORT_DEV: ::c_int = 21;
pub const _SC_2_FORT_RUN: ::c_int = 22;
pub const _SC_2_LOCALEDEF: ::c_int = 23;
pub const _SC_2_SW_DEV: ::c_int = 24;
pub const _SC_2_UPE: ::c_int = 25;
pub const _SC_STREAM_MAX: ::c_int = 26;
pub const _SC_TZNAME_MAX: ::c_int = 27;
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
pub const _SC_PAGESIZE: ::c_int = 29;
pub const _SC_MEMLOCK: ::c_int = 30;
pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
pub const _SC_MESSAGE_PASSING: ::c_int = 33;
pub const _SC_PRIORITIZED_IO: ::c_int = 34;
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
pub const _SC_SEMAPHORES: ::c_int = 37;
pub const _SC_FSYNC: ::c_int = 38;
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
pub const _SC_TIMERS: ::c_int = 41;
pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
pub const _SC_AIO_MAX: ::c_int = 43;
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
pub const _SC_MAPPED_FILES: ::c_int = 47;
pub const _SC_RTSIG_MAX: ::c_int = 48;
pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
pub const _SC_TIMER_MAX: ::c_int = 52;
pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
pub const _SC_2_PBS: ::c_int = 59;
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
pub const _SC_2_PBS_LOCATE: ::c_int = 62;
pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
pub const _SC_2_PBS_TRACK: ::c_int = 64;
pub const _SC_ADVISORY_INFO: ::c_int = 65;
pub const _SC_BARRIERS: ::c_int = 66;
pub const _SC_CLOCK_SELECTION: ::c_int = 67;
pub const _SC_CPUTIME: ::c_int = 68;
pub const _SC_FILE_LOCKING: ::c_int = 69;
pub const _SC_HOST_NAME_MAX: ::c_int = 72;
pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
pub const _SC_REGEXP: ::c_int = 77;
pub const _SC_SHELL: ::c_int = 78;
pub const _SC_SPAWN: ::c_int = 79;
pub const _SC_SPIN_LOCKS: ::c_int = 80;
pub const _SC_SPORADIC_SERVER: ::c_int = 81;
pub const _SC_THREAD_CPUTIME: ::c_int = 84;
pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
pub const _SC_TIMEOUTS: ::c_int = 95;
pub const _SC_TRACE: ::c_int = 97;
pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
pub const _SC_TRACE_INHERIT: ::c_int = 99;
pub const _SC_TRACE_LOG: ::c_int = 100;
pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
pub const _SC_V6_LP64_OFF64: ::c_int = 105;
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
pub const _SC_IPV6: ::c_int = 118;
pub const _SC_RAW_SOCKETS: ::c_int = 119;
pub const _SC_SYMLOOP_MAX: ::c_int = 120;
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_XOPEN_STREAMS: ::c_int = 114;
pub const _SC_XBS5_ILP32_OFF32: ::c_int = 122;
pub const _SC_XBS5_ILP32_OFFBIG: ::c_int = 123;
pub const _SC_XBS5_LP64_OFF64: ::c_int = 124;
pub const _SC_XBS5_LPBIG_OFFBIG: ::c_int = 125;
pub const _SC_SS_REPL_MAX: ::c_int = 126;
pub const _SC_TRACE_EVENT_NAME_MAX: ::c_int = 127;
pub const _SC_TRACE_NAME_MAX: ::c_int = 128;
pub const _SC_TRACE_SYS_MAX: ::c_int = 129;
pub const _SC_TRACE_USER_EVENT_MAX: ::c_int = 130;
pub const _SC_PASS_MAX: ::c_int = 131;
// `confstr` keys (only the values guaranteed by `man confstr`).
pub const _CS_PATH: ::c_int = 1;
pub const _CS_DARWIN_USER_DIR: ::c_int = 65536;
pub const _CS_DARWIN_USER_TEMP_DIR: ::c_int = 65537;
pub const _CS_DARWIN_USER_CACHE_DIR: ::c_int = 65538;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const _PTHREAD_MUTEX_SIG_init: ::c_long = 0x32AAABA7;
pub const _PTHREAD_COND_SIG_init: ::c_long = 0x3CB0B1BB;
pub const _PTHREAD_RWLOCK_SIG_init: ::c_long = 0x2DA8B3B4;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
__sig: _PTHREAD_MUTEX_SIG_init,
__opaque: [0; __PTHREAD_MUTEX_SIZE__],
};
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
__sig: _PTHREAD_COND_SIG_init,
__opaque: [0; __PTHREAD_COND_SIZE__],
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
__sig: _PTHREAD_RWLOCK_SIG_init,
__opaque: [0; __PTHREAD_RWLOCK_SIZE__],
};
pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock {
_os_unfair_lock_opaque: 0,
};
pub const OS_LOG_TYPE_DEFAULT: ::os_log_type_t = 0x00;
pub const OS_LOG_TYPE_INFO: ::os_log_type_t = 0x01;
pub const OS_LOG_TYPE_DEBUG: ::os_log_type_t = 0x02;
pub const OS_LOG_TYPE_ERROR: ::os_log_type_t = 0x10;
pub const OS_LOG_TYPE_FAULT: ::os_log_type_t = 0x11;
pub const OS_SIGNPOST_EVENT: ::os_signpost_type_t = 0x00;
pub const OS_SIGNPOST_INTERVAL_BEGIN: ::os_signpost_type_t = 0x01;
pub const OS_SIGNPOST_INTERVAL_END: ::os_signpost_type_t = 0x02;
pub const MINSIGSTKSZ: ::size_t = 32768;
pub const SIGSTKSZ: ::size_t = 131072;
pub const FD_SETSIZE: usize = 1024;
pub const ST_NOSUID: ::c_ulong = 2;
pub const SCHED_OTHER: ::c_int = 1;
pub const SCHED_FIFO: ::c_int = 4;
pub const SCHED_RR: ::c_int = 2;
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
pub const EVFILT_MACHPORT: i16 = -8;
pub const EVFILT_FS: i16 = -9;
pub const EVFILT_USER: i16 = -10;
pub const EVFILT_VM: i16 = -12;
pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
pub const EV_FLAG0: u16 = 0x1000;
pub const EV_POLL: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_OOBAND: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
pub const NOTE_FFOR: u32 = 0x80000000;
pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
pub const NOTE_NONE: u32 = 0x00000080;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
pub const NOTE_REAP: u32 = 0x10000000;
pub const NOTE_SIGNAL: u32 = 0x08000000;
pub const NOTE_EXITSTATUS: u32 = 0x04000000;
pub const NOTE_EXIT_DETAIL: u32 = 0x02000000;
pub const NOTE_PDATAMASK: u32 = 0x000fffff;
pub const NOTE_PCTRLMASK: u32 = 0xfff00000;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")]
pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000;
pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000;
pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000;
pub const NOTE_EXIT_MEMORY: u32 = 0x00020000;
pub const NOTE_EXIT_CSERROR: u32 = 0x00040000;
pub const NOTE_VM_PRESSURE: u32 = 0x80000000;
pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000;
pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000;
pub const NOTE_VM_ERROR: u32 = 0x10000000;
pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_USECONDS: u32 = 0x00000002;
pub const NOTE_NSECONDS: u32 = 0x00000004;
pub const NOTE_ABSOLUTE: u32 = 0x00000008;
pub const NOTE_LEEWAY: u32 = 0x00000010;
pub const NOTE_CRITICAL: u32 = 0x00000020;
pub const NOTE_BACKGROUND: u32 = 0x00000040;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
pub const OCRNL: ::tcflag_t = 0x00000010;
pub const ONOCR: ::tcflag_t = 0x00000020;
pub const ONLRET: ::tcflag_t = 0x00000040;
pub const OFILL: ::tcflag_t = 0x00000080;
pub const NLDLY: ::tcflag_t = 0x00000300;
pub const TABDLY: ::tcflag_t = 0x00000c04;
pub const CRDLY: ::tcflag_t = 0x00003000;
pub const FFDLY: ::tcflag_t = 0x00004000;
pub const BSDLY: ::tcflag_t = 0x00008000;
pub const VTDLY: ::tcflag_t = 0x00010000;
pub const OFDEL: ::tcflag_t = 0x00020000;
pub const NL0: ::tcflag_t = 0x00000000;
pub const NL1: ::tcflag_t = 0x00000100;
pub const TAB0: ::tcflag_t = 0x00000000;
pub const TAB1: ::tcflag_t = 0x00000400;
pub const TAB2: ::tcflag_t = 0x00000800;
pub const CR0: ::tcflag_t = 0x00000000;
pub const CR1: ::tcflag_t = 0x00001000;
pub const CR2: ::tcflag_t = 0x00002000;
pub const CR3: ::tcflag_t = 0x00003000;
pub const FF0: ::tcflag_t = 0x00000000;
pub const FF1: ::tcflag_t = 0x00004000;
pub const BS0: ::tcflag_t = 0x00000000;
pub const BS1: ::tcflag_t = 0x00008000;
pub const TAB3: ::tcflag_t = 0x00000004;
pub const VT0: ::tcflag_t = 0x00000000;
pub const VT1: ::tcflag_t = 0x00010000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CRTSCTS: ::tcflag_t = 0x00030000;
pub const NI_MAXHOST: ::socklen_t = 1025;
pub const NI_MAXSERV: ::socklen_t = 32;
pub const NI_NOFQDN: ::c_int = 0x00000001;
pub const NI_NUMERICHOST: ::c_int = 0x00000002;
pub const NI_NAMEREQD: ::c_int = 0x00000004;
pub const NI_NUMERICSERV: ::c_int = 0x00000008;
pub const NI_NUMERICSCOPE: ::c_int = 0x00000100;
pub const NI_DGRAM: ::c_int = 0x00000010;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;
pub const RENAME_SWAP: ::c_uint = 0x00000002;
pub const RENAME_EXCL: ::c_uint = 0x00000004;
pub const RTLD_LOCAL: ::c_int = 0x4;
pub const RTLD_FIRST: ::c_int = 0x100;
pub const RTLD_NODELETE: ::c_int = 0x80;
pub const RTLD_NOLOAD: ::c_int = 0x10;
pub const RTLD_GLOBAL: ::c_int = 0x8;
pub const RTLD_MAIN_ONLY: *mut ::c_void = -5isize as *mut ::c_void;
pub const _WSTOPPED: ::c_int = 0o177;
pub const LOG_NETINFO: ::c_int = 12 << 3;
pub const LOG_REMOTEAUTH: ::c_int = 13 << 3;
pub const LOG_INSTALL: ::c_int = 14 << 3;
pub const LOG_RAS: ::c_int = 15 << 3;
pub const LOG_LAUNCHD: ::c_int = 24 << 3;
pub const LOG_NFACILITIES: ::c_int = 25;
pub const CTLTYPE: ::c_int = 0xf;
pub const CTLTYPE_NODE: ::c_int = 1;
pub const CTLTYPE_INT: ::c_int = 2;
pub const CTLTYPE_STRING: ::c_int = 3;
pub const CTLTYPE_QUAD: ::c_int = 4;
pub const CTLTYPE_OPAQUE: ::c_int = 5;
pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
pub const CTLFLAG_RD: ::c_int = 0x80000000;
pub const CTLFLAG_WR: ::c_int = 0x40000000;
pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
pub const CTLFLAG_NOLOCK: ::c_int = 0x20000000;
pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
pub const CTLFLAG_MASKED: ::c_int = 0x04000000;
pub const CTLFLAG_NOAUTO: ::c_int = 0x02000000;
pub const CTLFLAG_KERN: ::c_int = 0x01000000;
pub const CTLFLAG_LOCKED: ::c_int = 0x00800000;
pub const CTLFLAG_OID2: ::c_int = 0x00400000;
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
pub const CTL_NET: ::c_int = 4;
pub const CTL_DEBUG: ::c_int = 5;
pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_MAXID: ::c_int = 9;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
pub const KERN_VERSION: ::c_int = 4;
pub const KERN_MAXVNODES: ::c_int = 5;
pub const KERN_MAXPROC: ::c_int = 6;
pub const KERN_MAXFILES: ::c_int = 7;
pub const KERN_ARGMAX: ::c_int = 8;
pub const KERN_SECURELVL: ::c_int = 9;
pub const KERN_HOSTNAME: ::c_int = 10;
pub const KERN_HOSTID: ::c_int = 11;
pub const KERN_CLOCKRATE: ::c_int = 12;
pub const KERN_VNODE: ::c_int = 13;
pub const KERN_PROC: ::c_int = 14;
pub const KERN_FILE: ::c_int = 15;
pub const KERN_PROF: ::c_int = 16;
pub const KERN_POSIX1: ::c_int = 17;
pub const KERN_NGROUPS: ::c_int = 18;
pub const KERN_JOB_CONTROL: ::c_int = 19;
pub const KERN_SAVED_IDS: ::c_int = 20;
pub const KERN_BOOTTIME: ::c_int = 21;
pub const KERN_NISDOMAINNAME: ::c_int = 22;
pub const KERN_DOMAINNAME: ::c_int = KERN_NISDOMAINNAME;
pub const KERN_MAXPARTITIONS: ::c_int = 23;
pub const KERN_KDEBUG: ::c_int = 24;
pub const KERN_UPDATEINTERVAL: ::c_int = 25;
pub const KERN_OSRELDATE: ::c_int = 26;
pub const KERN_NTP_PLL: ::c_int = 27;
pub const KERN_BOOTFILE: ::c_int = 28;
pub const KERN_MAXFILESPERPROC: ::c_int = 29;
pub const KERN_MAXPROCPERUID: ::c_int = 30;
pub const KERN_DUMPDEV: ::c_int = 31;
pub const KERN_IPC: ::c_int = 32;
pub const KERN_DUMMY: ::c_int = 33;
pub const KERN_PS_STRINGS: ::c_int = 34;
pub const KERN_USRSTACK32: ::c_int = 35;
pub const KERN_LOGSIGEXIT: ::c_int = 36;
pub const KERN_SYMFILE: ::c_int = 37;
pub const KERN_PROCARGS: ::c_int = 38;
pub const KERN_NETBOOT: ::c_int = 40;
pub const KERN_SYSV: ::c_int = 42;
pub const KERN_AFFINITY: ::c_int = 43;
pub const KERN_TRANSLATE: ::c_int = 44;
pub const KERN_CLASSIC: ::c_int = KERN_TRANSLATE;
pub const KERN_EXEC: ::c_int = 45;
pub const KERN_CLASSICHANDLER: ::c_int = KERN_EXEC;
pub const KERN_AIOMAX: ::c_int = 46;
pub const KERN_AIOPROCMAX: ::c_int = 47;
pub const KERN_AIOTHREADS: ::c_int = 48;
pub const KERN_COREFILE: ::c_int = 50;
pub const KERN_COREDUMP: ::c_int = 51;
pub const KERN_SUGID_COREDUMP: ::c_int = 52;
pub const KERN_PROCDELAYTERM: ::c_int = 53;
pub const KERN_SHREG_PRIVATIZABLE: ::c_int = 54;
pub const KERN_LOW_PRI_WINDOW: ::c_int = 56;
pub const KERN_LOW_PRI_DELAY: ::c_int = 57;
pub const KERN_POSIX: ::c_int = 58;
pub const KERN_USRSTACK64: ::c_int = 59;
pub const KERN_NX_PROTECTION: ::c_int = 60;
pub const KERN_TFP: ::c_int = 61;
pub const KERN_PROCNAME: ::c_int = 62;
pub const KERN_THALTSTACK: ::c_int = 63;
pub const KERN_SPECULATIVE_READS: ::c_int = 64;
pub const KERN_OSVERSION: ::c_int = 65;
pub const KERN_SAFEBOOT: ::c_int = 66;
pub const KERN_RAGEVNODE: ::c_int = 68;
pub const KERN_TTY: ::c_int = 69;
pub const KERN_CHECKOPENEVT: ::c_int = 70;
pub const KERN_THREADNAME: ::c_int = 71;
pub const KERN_MAXID: ::c_int = 72;
pub const KERN_RAGE_PROC: ::c_int = 1;
pub const KERN_RAGE_THREAD: ::c_int = 2;
pub const KERN_UNRAGE_PROC: ::c_int = 3;
pub const KERN_UNRAGE_THREAD: ::c_int = 4;
pub const KERN_OPENEVT_PROC: ::c_int = 1;
pub const KERN_UNOPENEVT_PROC: ::c_int = 2;
pub const KERN_TFP_POLICY: ::c_int = 1;
pub const KERN_TFP_POLICY_DENY: ::c_int = 0;
pub const KERN_TFP_POLICY_DEFAULT: ::c_int = 2;
pub const KERN_KDEFLAGS: ::c_int = 1;
pub const KERN_KDDFLAGS: ::c_int = 2;
pub const KERN_KDENABLE: ::c_int = 3;
pub const KERN_KDSETBUF: ::c_int = 4;
pub const KERN_KDGETBUF: ::c_int = 5;
pub const KERN_KDSETUP: ::c_int = 6;
pub const KERN_KDREMOVE: ::c_int = 7;
pub const KERN_KDSETREG: ::c_int = 8;
pub const KERN_KDGETREG: ::c_int = 9;
pub const KERN_KDREADTR: ::c_int = 10;
pub const KERN_KDPIDTR: ::c_int = 11;
pub const KERN_KDTHRMAP: ::c_int = 12;
pub const KERN_KDPIDEX: ::c_int = 14;
pub const KERN_KDSETRTCDEC: ::c_int = 15;
pub const KERN_KDGETENTROPY: ::c_int = 16;
pub const KERN_KDWRITETR: ::c_int = 17;
pub const KERN_KDWRITEMAP: ::c_int = 18;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
pub const KERN_KDENABLE_BG_TRACE: ::c_int = 19;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")]
pub const KERN_KDDISABLE_BG_TRACE: ::c_int = 20;
pub const KERN_KDREADCURTHRMAP: ::c_int = 21;
pub const KERN_KDSET_TYPEFILTER: ::c_int = 22;
pub const KERN_KDBUFWAIT: ::c_int = 23;
pub const KERN_KDCPUMAP: ::c_int = 24;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
pub const KERN_PROC_SESSION: ::c_int = 3;
pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_LCID: ::c_int = 7;
pub const KERN_SUCCESS: ::c_int = 0;
pub const KERN_INVALID_ADDRESS: ::c_int = 1;
pub const KERN_PROTECTION_FAILURE: ::c_int = 2;
pub const KERN_NO_SPACE: ::c_int = 3;
pub const KERN_INVALID_ARGUMENT: ::c_int = 4;
pub const KERN_FAILURE: ::c_int = 5;
pub const KERN_RESOURCE_SHORTAGE: ::c_int = 6;
pub const KERN_NOT_RECEIVER: ::c_int = 7;
pub const KERN_NO_ACCESS: ::c_int = 8;
pub const KERN_MEMORY_FAILURE: ::c_int = 9;
pub const KERN_MEMORY_ERROR: ::c_int = 10;
pub const KERN_ALREADY_IN_SET: ::c_int = 11;
pub const KERN_NOT_IN_SET: ::c_int = 12;
pub const KERN_NAME_EXISTS: ::c_int = 13;
pub const KERN_ABORTED: ::c_int = 14;
pub const KERN_INVALID_NAME: ::c_int = 15;
pub const KERN_INVALID_TASK: ::c_int = 16;
pub const KERN_INVALID_RIGHT: ::c_int = 17;
pub const KERN_INVALID_VALUE: ::c_int = 18;
pub const KERN_UREFS_OVERFLOW: ::c_int = 19;
pub const KERN_INVALID_CAPABILITY: ::c_int = 20;
pub const KERN_RIGHT_EXISTS: ::c_int = 21;
pub const KERN_INVALID_HOST: ::c_int = 22;
pub const KERN_MEMORY_PRESENT: ::c_int = 23;
pub const KERN_MEMORY_DATA_MOVED: ::c_int = 24;
pub const KERN_MEMORY_RESTART_COPY: ::c_int = 25;
pub const KERN_INVALID_PROCESSOR_SET: ::c_int = 26;
pub const KERN_POLICY_LIMIT: ::c_int = 27;
pub const KERN_INVALID_POLICY: ::c_int = 28;
pub const KERN_INVALID_OBJECT: ::c_int = 29;
pub const KERN_ALREADY_WAITING: ::c_int = 30;
pub const KERN_DEFAULT_SET: ::c_int = 31;
pub const KERN_EXCEPTION_PROTECTED: ::c_int = 32;
pub const KERN_INVALID_LEDGER: ::c_int = 33;
pub const KERN_INVALID_MEMORY_CONTROL: ::c_int = 34;
pub const KERN_INVALID_SECURITY: ::c_int = 35;
pub const KERN_NOT_DEPRESSED: ::c_int = 36;
pub const KERN_TERMINATED: ::c_int = 37;
pub const KERN_LOCK_SET_DESTROYED: ::c_int = 38;
pub const KERN_LOCK_UNSTABLE: ::c_int = 39;
pub const KERN_LOCK_OWNED: ::c_int = 40;
pub const KERN_LOCK_OWNED_SELF: ::c_int = 41;
pub const KERN_SEMAPHORE_DESTROYED: ::c_int = 42;
pub const KERN_RPC_SERVER_TERMINATED: ::c_int = 43;
pub const KERN_RPC_TERMINATE_ORPHAN: ::c_int = 44;
pub const KERN_RPC_CONTINUE_ORPHAN: ::c_int = 45;
pub const KERN_NOT_SUPPORTED: ::c_int = 46;
pub const KERN_NODE_DOWN: ::c_int = 47;
pub const KERN_NOT_WAITING: ::c_int = 48;
pub const KERN_OPERATION_TIMED_OUT: ::c_int = 49;
pub const KERN_CODESIGN_ERROR: ::c_int = 50;
pub const KERN_POLICY_STATIC: ::c_int = 51;
pub const KERN_INSUFFICIENT_BUFFER_SIZE: ::c_int = 52;
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
pub const KIPC_MAX_LINKHDR: ::c_int = 4;
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
pub const KIPC_MAX_HDR: ::c_int = 6;
pub const KIPC_MAX_DATALEN: ::c_int = 7;
pub const KIPC_MBSTAT: ::c_int = 8;
pub const KIPC_NMBCLUSTERS: ::c_int = 9;
pub const KIPC_SOQLIMITCOMPAT: ::c_int = 10;
pub const VM_METER: ::c_int = 1;
pub const VM_LOADAVG: ::c_int = 2;
pub const VM_MACHFACTOR: ::c_int = 4;
pub const VM_SWAPUSAGE: ::c_int = 5;
pub const VM_MAXID: ::c_int = 6;
pub const VM_PROT_NONE: ::vm_prot_t = 0x00;
pub const VM_PROT_READ: ::vm_prot_t = 0x01;
pub const VM_PROT_WRITE: ::vm_prot_t = 0x02;
pub const VM_PROT_EXECUTE: ::vm_prot_t = 0x04;
pub const MEMORY_OBJECT_NULL: ::memory_object_t = 0;
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
pub const HW_BYTEORDER: ::c_int = 4;
pub const HW_PHYSMEM: ::c_int = 5;
pub const HW_USERMEM: ::c_int = 6;
pub const HW_PAGESIZE: ::c_int = 7;
pub const HW_DISKNAMES: ::c_int = 8;
pub const HW_DISKSTATS: ::c_int = 9;
pub const HW_EPOCH: ::c_int = 10;
pub const HW_FLOATINGPT: ::c_int = 11;
pub const HW_MACHINE_ARCH: ::c_int = 12;
pub const HW_VECTORUNIT: ::c_int = 13;
pub const HW_BUS_FREQ: ::c_int = 14;
pub const HW_CPU_FREQ: ::c_int = 15;
pub const HW_CACHELINE: ::c_int = 16;
pub const HW_L1ICACHESIZE: ::c_int = 17;
pub const HW_L1DCACHESIZE: ::c_int = 18;
pub const HW_L2SETTINGS: ::c_int = 19;
pub const HW_L2CACHESIZE: ::c_int = 20;
pub const HW_L3SETTINGS: ::c_int = 21;
pub const HW_L3CACHESIZE: ::c_int = 22;
pub const HW_TB_FREQ: ::c_int = 23;
pub const HW_MEMSIZE: ::c_int = 24;
pub const HW_AVAILCPU: ::c_int = 25;
pub const HW_TARGET: ::c_int = 26;
pub const HW_PRODUCT: ::c_int = 27;
pub const HW_MAXID: ::c_int = 28;
pub const USER_CS_PATH: ::c_int = 1;
pub const USER_BC_BASE_MAX: ::c_int = 2;
pub const USER_BC_DIM_MAX: ::c_int = 3;
pub const USER_BC_SCALE_MAX: ::c_int = 4;
pub const USER_BC_STRING_MAX: ::c_int = 5;
pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
pub const USER_EXPR_NEST_MAX: ::c_int = 7;
pub const USER_LINE_MAX: ::c_int = 8;
pub const USER_RE_DUP_MAX: ::c_int = 9;
pub const USER_POSIX2_VERSION: ::c_int = 10;
pub const USER_POSIX2_C_BIND: ::c_int = 11;
pub const USER_POSIX2_C_DEV: ::c_int = 12;
pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
pub const USER_POSIX2_SW_DEV: ::c_int = 17;
pub const USER_POSIX2_UPE: ::c_int = 18;
pub const USER_STREAM_MAX: ::c_int = 19;
pub const USER_TZNAME_MAX: ::c_int = 20;
pub const USER_MAXID: ::c_int = 21;
pub const CTL_DEBUG_NAME: ::c_int = 0;
pub const CTL_DEBUG_VALUE: ::c_int = 1;
pub const CTL_DEBUG_MAXID: ::c_int = 20;
pub const PRIO_DARWIN_THREAD: ::c_int = 3;
pub const PRIO_DARWIN_PROCESS: ::c_int = 4;
pub const PRIO_DARWIN_BG: ::c_int = 0x1000;
pub const PRIO_DARWIN_NONUI: ::c_int = 0x1001;
pub const SEM_FAILED: *mut sem_t = -1isize as *mut ::sem_t;
pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00001000;
pub const AI_MASK: ::c_int =
AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG;
pub const AI_ALL: ::c_int = 0x00000100;
pub const AI_V4MAPPED_CFG: ::c_int = 0x00000200;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
pub const AI_V4MAPPED: ::c_int = 0x00000800;
pub const AI_DEFAULT: ::c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG;
pub const AI_UNUSABLE: ::c_int = 0x10000000;
pub const SIGEV_NONE: ::c_int = 0;
pub const SIGEV_SIGNAL: ::c_int = 1;
pub const SIGEV_THREAD: ::c_int = 3;
pub const AIO_CANCELED: ::c_int = 2;
pub const AIO_NOTCANCELED: ::c_int = 4;
pub const AIO_ALLDONE: ::c_int = 1;
#[deprecated(
since = "0.2.64",
note = "Can vary at runtime. Use sysconf(3) instead"
)]
pub const AIO_LISTIO_MAX: ::c_int = 16;
pub const LIO_NOP: ::c_int = 0;
pub const LIO_WRITE: ::c_int = 2;
pub const LIO_READ: ::c_int = 1;
pub const LIO_WAIT: ::c_int = 2;
pub const LIO_NOWAIT: ::c_int = 1;
pub const WEXITED: ::c_int = 0x00000004;
pub const WSTOPPED: ::c_int = 0x00000008;
pub const WCONTINUED: ::c_int = 0x00000010;
pub const WNOWAIT: ::c_int = 0x00000020;
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 2;
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;
pub const XATTR_NOFOLLOW: ::c_int = 0x0001;
pub const XATTR_CREATE: ::c_int = 0x0002;
pub const XATTR_REPLACE: ::c_int = 0x0004;
pub const XATTR_NOSECURITY: ::c_int = 0x0008;
pub const XATTR_NODEFAULT: ::c_int = 0x0010;
pub const XATTR_SHOWCOMPRESSION: ::c_int = 0x0020;
pub const NET_RT_IFLIST2: ::c_int = 0x0006;
// net/route.h
pub const RTF_UP: ::c_int = 0x1;
pub const RTF_GATEWAY: ::c_int = 0x2;
pub const RTF_HOST: ::c_int = 0x4;
pub const RTF_REJECT: ::c_int = 0x8;
pub const RTF_DYNAMIC: ::c_int = 0x10;
pub const RTF_MODIFIED: ::c_int = 0x20;
pub const RTF_DONE: ::c_int = 0x40;
pub const RTF_DELCLONE: ::c_int = 0x80;
pub const RTF_CLONING: ::c_int = 0x100;
pub const RTF_XRESOLVE: ::c_int = 0x200;
pub const RTF_LLINFO: ::c_int = 0x400;
pub const RTF_STATIC: ::c_int = 0x800;
pub const RTF_BLACKHOLE: ::c_int = 0x1000;
pub const RTF_NOIFREF: ::c_int = 0x2000;
pub const RTF_PROTO2: ::c_int = 0x4000;
pub const RTF_PROTO1: ::c_int = 0x8000;
pub const RTF_PRCLONING: ::c_int = 0x10000;
pub const RTF_WASCLONED: ::c_int = 0x20000;
pub const RTF_PROTO3: ::c_int = 0x40000;
pub const RTF_PINNED: ::c_int = 0x100000;
pub const RTF_LOCAL: ::c_int = 0x200000;
pub const RTF_BROADCAST: ::c_int = 0x400000;
pub const RTF_MULTICAST: ::c_int = 0x800000;
pub const RTF_IFSCOPE: ::c_int = 0x1000000;
pub const RTF_CONDEMNED: ::c_int = 0x2000000;
pub const RTF_IFREF: ::c_int = 0x4000000;
pub const RTF_PROXY: ::c_int = 0x8000000;
pub const RTF_ROUTER: ::c_int = 0x10000000;
pub const RTF_DEAD: ::c_int = 0x20000000;
pub const RTF_GLOBAL: ::c_int = 0x40000000;
pub const RTM_VERSION: ::c_int = 5;
// Message types
pub const RTM_ADD: ::c_int = 0x1;
pub const RTM_DELETE: ::c_int = 0x2;
pub const RTM_CHANGE: ::c_int = 0x3;
pub const RTM_GET: ::c_int = 0x4;
pub const RTM_LOSING: ::c_int = 0x5;
pub const RTM_REDIRECT: ::c_int = 0x6;
pub const RTM_MISS: ::c_int = 0x7;
pub const RTM_LOCK: ::c_int = 0x8;
pub const RTM_OLDADD: ::c_int = 0x9;
pub const RTM_OLDDEL: ::c_int = 0xa;
pub const RTM_RESOLVE: ::c_int = 0xb;
pub const RTM_NEWADDR: ::c_int = 0xc;
pub const RTM_DELADDR: ::c_int = 0xd;
pub const RTM_IFINFO: ::c_int = 0xe;
pub const RTM_NEWMADDR: ::c_int = 0xf;
pub const RTM_DELMADDR: ::c_int = 0x10;
pub const RTM_IFINFO2: ::c_int = 0x12;
pub const RTM_NEWMADDR2: ::c_int = 0x13;
pub const RTM_GET2: ::c_int = 0x14;
// Bitmask values for rtm_inits and rmx_locks.
pub const RTV_MTU: ::c_int = 0x1;
pub const RTV_HOPCOUNT: ::c_int = 0x2;
pub const RTV_EXPIRE: ::c_int = 0x4;
pub const RTV_RPIPE: ::c_int = 0x8;
pub const RTV_SPIPE: ::c_int = 0x10;
pub const RTV_SSTHRESH: ::c_int = 0x20;
pub const RTV_RTT: ::c_int = 0x40;
pub const RTV_RTTVAR: ::c_int = 0x80;
// Bitmask values for rtm_addrs.
pub const RTA_DST: ::c_int = 0x1;
pub const RTA_GATEWAY: ::c_int = 0x2;
pub const RTA_NETMASK: ::c_int = 0x4;
pub const RTA_GENMASK: ::c_int = 0x8;
pub const RTA_IFP: ::c_int = 0x10;
pub const RTA_IFA: ::c_int = 0x20;
pub const RTA_AUTHOR: ::c_int = 0x40;
pub const RTA_BRD: ::c_int = 0x80;
// Index offsets for sockaddr array for alternate internal encoding.
pub const RTAX_DST: ::c_int = 0;
pub const RTAX_GATEWAY: ::c_int = 1;
pub const RTAX_NETMASK: ::c_int = 2;
pub const RTAX_GENMASK: ::c_int = 3;
pub const RTAX_IFP: ::c_int = 4;
pub const RTAX_IFA: ::c_int = 5;
pub const RTAX_AUTHOR: ::c_int = 6;
pub const RTAX_BRD: ::c_int = 7;
pub const RTAX_MAX: ::c_int = 8;
pub const KERN_PROCARGS2: ::c_int = 49;
pub const PROC_PIDTASKALLINFO: ::c_int = 2;
pub const PROC_PIDTBSDINFO: ::c_int = 3;
pub const PROC_PIDTASKINFO: ::c_int = 4;
pub const PROC_PIDTHREADINFO: ::c_int = 5;
pub const PROC_PIDVNODEPATHINFO: ::c_int = 9;
pub const PROC_PIDPATHINFO_MAXSIZE: ::c_int = 4096;
pub const PROC_CSM_ALL: ::c_uint = 0x0001;
pub const PROC_CSM_NOSMT: ::c_uint = 0x0002;
pub const PROC_CSM_TECS: ::c_uint = 0x0004;
pub const MAXCOMLEN: usize = 16;
pub const MAXTHREADNAMESIZE: usize = 64;
pub const XUCRED_VERSION: ::c_uint = 0;
pub const LC_SEGMENT: u32 = 0x1;
pub const LC_SEGMENT_64: u32 = 0x19;
pub const MH_MAGIC: u32 = 0xfeedface;
pub const MH_MAGIC_64: u32 = 0xfeedfacf;
// net/if_utun.h
pub const UTUN_OPT_FLAGS: ::c_int = 1;
pub const UTUN_OPT_IFNAME: ::c_int = 2;
// net/bpf.h
pub const DLT_NULL: ::c_uint = 0; // no link-layer encapsulation
pub const DLT_EN10MB: ::c_uint = 1; // Ethernet (10Mb)
pub const DLT_EN3MB: ::c_uint = 2; // Experimental Ethernet (3Mb)
pub const DLT_AX25: ::c_uint = 3; // Amateur Radio AX.25
pub const DLT_PRONET: ::c_uint = 4; // Proteon ProNET Token Ring
pub const DLT_CHAOS: ::c_uint = 5; // Chaos
pub const DLT_IEEE802: ::c_uint = 6; // IEEE 802 Networks
pub const DLT_ARCNET: ::c_uint = 7; // ARCNET
pub const DLT_SLIP: ::c_uint = 8; // Serial Line IP
pub const DLT_PPP: ::c_uint = 9; // Point-to-point Protocol
pub const DLT_FDDI: ::c_uint = 10; // FDDI
pub const DLT_ATM_RFC1483: ::c_uint = 11; // LLC/SNAP encapsulated atm
pub const DLT_RAW: ::c_uint = 12; // raw IP
pub const DLT_LOOP: ::c_uint = 108;
// https://github.com/apple/darwin-xnu/blob/HEAD/bsd/net/bpf.h#L100
// sizeof(i32)
pub const BPF_ALIGNMENT: ::c_int = 4;
// sys/mount.h
pub const MNT_NODEV: ::c_int = 0x00000010;
pub const MNT_UNION: ::c_int = 0x00000020;
pub const MNT_CPROTECT: ::c_int = 0x00000080;
// MAC labeled / "quarantined" flag
pub const MNT_QUARANTINE: ::c_int = 0x00000400;
// Flags set by internal operations.
pub const MNT_LOCAL: ::c_int = 0x00001000;
pub const MNT_QUOTA: ::c_int = 0x00002000;
pub const MNT_ROOTFS: ::c_int = 0x00004000;
pub const MNT_DOVOLFS: ::c_int = 0x00008000;
pub const MNT_DONTBROWSE: ::c_int = 0x00100000;
pub const MNT_IGNORE_OWNERSHIP: ::c_int = 0x00200000;
pub const MNT_AUTOMOUNTED: ::c_int = 0x00400000;
pub const MNT_JOURNALED: ::c_int = 0x00800000;
pub const MNT_NOUSERXATTR: ::c_int = 0x01000000;
pub const MNT_DEFWRITE: ::c_int = 0x02000000;
pub const MNT_MULTILABEL: ::c_int = 0x04000000;
pub const MNT_NOATIME: ::c_int = 0x10000000;
pub const MNT_SNAPSHOT: ::c_int = 0x40000000;
// External filesystem command modifier flags.
pub const MNT_NOBLOCK: ::c_int = 0x00020000;
// sys/spawn.h:
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x0001;
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x0002;
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x0004;
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x0008;
pub const POSIX_SPAWN_SETEXEC: ::c_int = 0x0040;
pub const POSIX_SPAWN_START_SUSPENDED: ::c_int = 0x0080;
pub const POSIX_SPAWN_CLOEXEC_DEFAULT: ::c_int = 0x4000;
// sys/ipc.h:
pub const IPC_CREAT: ::c_int = 0x200;
pub const IPC_EXCL: ::c_int = 0x400;
pub const IPC_NOWAIT: ::c_int = 0x800;
pub const IPC_PRIVATE: key_t = 0;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_R: ::c_int = 0x100;
pub const IPC_W: ::c_int = 0x80;
pub const IPC_M: ::c_int = 0x1000;
// sys/sem.h
pub const SEM_UNDO: ::c_int = 0o10000;
pub const GETNCNT: ::c_int = 3;
pub const GETPID: ::c_int = 4;
pub const GETVAL: ::c_int = 5;
pub const GETALL: ::c_int = 6;
pub const GETZCNT: ::c_int = 7;
pub const SETVAL: ::c_int = 8;
pub const SETALL: ::c_int = 9;
// sys/shm.h
pub const SHM_RDONLY: ::c_int = 0x1000;
pub const SHM_RND: ::c_int = 0x2000;
#[cfg(target_arch = "aarch64")]
pub const SHMLBA: ::c_int = 16 * 1024;
#[cfg(not(target_arch = "aarch64"))]
pub const SHMLBA: ::c_int = 4096;
pub const SHM_R: ::c_int = IPC_R;
pub const SHM_W: ::c_int = IPC_W;
// Flags for chflags(2)
pub const UF_SETTABLE: ::c_uint = 0x0000ffff;
pub const UF_NODUMP: ::c_uint = 0x00000001;
pub const UF_IMMUTABLE: ::c_uint = 0x00000002;
pub const UF_APPEND: ::c_uint = 0x00000004;
pub const UF_OPAQUE: ::c_uint = 0x00000008;
pub const UF_COMPRESSED: ::c_uint = 0x00000020;
pub const UF_TRACKED: ::c_uint = 0x00000040;
pub const SF_SETTABLE: ::c_uint = 0xffff0000;
pub const SF_ARCHIVED: ::c_uint = 0x00010000;
pub const SF_IMMUTABLE: ::c_uint = 0x00020000;
pub const SF_APPEND: ::c_uint = 0x00040000;
pub const UF_HIDDEN: ::c_uint = 0x00008000;
//
pub const NTP_API: ::c_int = 4;
pub const MAXPHASE: ::c_long = 500000000;
pub const MAXFREQ: ::c_long = 500000;
pub const MINSEC: ::c_int = 256;
pub const MAXSEC: ::c_int = 2048;
pub const NANOSECOND: ::c_long = 1000000000;
pub const SCALE_PPM: ::c_int = 65;
pub const MAXTC: ::c_int = 10;
pub const MOD_OFFSET: ::c_uint = 0x0001;
pub const MOD_FREQUENCY: ::c_uint = 0x0002;
pub const MOD_MAXERROR: ::c_uint = 0x0004;
pub const MOD_ESTERROR: ::c_uint = 0x0008;
pub const MOD_STATUS: ::c_uint = 0x0010;
pub const MOD_TIMECONST: ::c_uint = 0x0020;
pub const MOD_PPSMAX: ::c_uint = 0x0040;
pub const MOD_TAI: ::c_uint = 0x0080;
pub const MOD_MICRO: ::c_uint = 0x1000;
pub const MOD_NANO: ::c_uint = 0x2000;
pub const MOD_CLKB: ::c_uint = 0x4000;
pub const MOD_CLKA: ::c_uint = 0x8000;
pub const STA_PLL: ::c_int = 0x0001;
pub const STA_PPSFREQ: ::c_int = 0x0002;
pub const STA_PPSTIME: ::c_int = 0x0004;
pub const STA_FLL: ::c_int = 0x0008;
pub const STA_INS: ::c_int = 0x0010;
pub const STA_DEL: ::c_int = 0x0020;
pub const STA_UNSYNC: ::c_int = 0x0040;
pub const STA_FREQHOLD: ::c_int = 0x0080;
pub const STA_PPSSIGNAL: ::c_int = 0x0100;
pub const STA_PPSJITTER: ::c_int = 0x0200;
pub const STA_PPSWANDER: ::c_int = 0x0400;
pub const STA_PPSERROR: ::c_int = 0x0800;
pub const STA_CLOCKERR: ::c_int = 0x1000;
pub const STA_NANO: ::c_int = 0x2000;
pub const STA_MODE: ::c_int = 0x4000;
pub const STA_CLK: ::c_int = 0x8000;
pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
| STA_PPSJITTER
| STA_PPSWANDER
| STA_PPSERROR
| STA_CLOCKERR
| STA_NANO
| STA_MODE
| STA_CLK;
pub const TIME_OK: ::c_int = 0;
pub const TIME_INS: ::c_int = 1;
pub const TIME_DEL: ::c_int = 2;
pub const TIME_OOP: ::c_int = 3;
pub const TIME_WAIT: ::c_int = 4;
pub const TIME_ERROR: ::c_int = 5;
//
pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
//
pub const THREAD_STANDARD_POLICY: ::c_int = 1;
pub const THREAD_STANDARD_POLICY_COUNT: ::c_int = 0;
pub const THREAD_EXTENDED_POLICY: ::c_int = 1;
pub const THREAD_TIME_CONSTRAINT_POLICY: ::c_int = 2;
pub const THREAD_PRECEDENCE_POLICY: ::c_int = 3;
pub const THREAD_AFFINITY_POLICY: ::c_int = 4;
pub const THREAD_AFFINITY_TAG_NULL: ::c_int = 0;
pub const THREAD_BACKGROUND_POLICY: ::c_int = 5;
pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: ::c_int = 0x1000;
pub const THREAD_LATENCY_QOS_POLICY: ::c_int = 7;
pub const THREAD_THROUGHPUT_QOS_POLICY: ::c_int = 8;
//
pub const TH_STATE_RUNNING: ::c_int = 1;
pub const TH_STATE_STOPPED: ::c_int = 2;
pub const TH_STATE_WAITING: ::c_int = 3;
pub const TH_STATE_UNINTERRUPTIBLE: ::c_int = 4;
pub const TH_STATE_HALTED: ::c_int = 5;
pub const TH_FLAGS_SWAPPED: ::c_int = 0x1;
pub const TH_FLAGS_IDLE: ::c_int = 0x2;
pub const TH_FLAGS_GLOBAL_FORCED_IDLE: ::c_int = 0x4;
pub const THREAD_BASIC_INFO: ::c_int = 3;
pub const THREAD_IDENTIFIER_INFO: ::c_int = 4;
pub const THREAD_EXTENDED_INFO: ::c_int = 5;
// CommonCrypto/CommonCryptoError.h
pub const kCCSuccess: i32 = 0;
pub const kCCParamError: i32 = -4300;
pub const kCCBufferTooSmall: i32 = -4301;
pub const kCCMemoryFailure: i32 = -4302;
pub const kCCAlignmentError: i32 = -4303;
pub const kCCDecodeError: i32 = -4304;
pub const kCCUnimplemented: i32 = -4305;
pub const kCCOverflow: i32 = -4306;
pub const kCCRNGFailure: i32 = -4307;
pub const kCCUnspecifiedError: i32 = -4308;
pub const kCCCallSequenceError: i32 = -4309;
pub const kCCKeySizeError: i32 = -4310;
pub const kCCInvalidKey: i32 = -4311;
// mach/host_info.h
pub const HOST_LOAD_INFO: i32 = 1;
pub const HOST_VM_INFO: i32 = 2;
pub const HOST_CPU_LOAD_INFO: i32 = 3;
pub const HOST_VM_INFO64: i32 = 4;
pub const HOST_EXTMOD_INFO64: i32 = 5;
pub const HOST_EXPIRED_TASK_INFO: i32 = 6;
// mach/vm_statistics.h
pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1;
pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2;
pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4;
pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8;
pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10;
pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20;
pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40;
pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80;
pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100;
pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200;
pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400;
// mach/task_info.h
pub const TASK_THREAD_TIMES_INFO: u32 = 3;
pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4;
pub const MACH_TASK_BASIC_INFO: u32 = 20;
pub const MACH_PORT_NULL: i32 = 0;
pub const RUSAGE_INFO_V0: ::c_int = 0;
pub const RUSAGE_INFO_V1: ::c_int = 1;
pub const RUSAGE_INFO_V2: ::c_int = 2;
pub const RUSAGE_INFO_V3: ::c_int = 3;
pub const RUSAGE_INFO_V4: ::c_int = 4;
// copyfile.h
pub const COPYFILE_ACL: ::copyfile_flags_t = 1 << 0;
pub const COPYFILE_STAT: ::copyfile_flags_t = 1 << 1;
pub const COPYFILE_XATTR: ::copyfile_flags_t = 1 << 2;
pub const COPYFILE_DATA: ::copyfile_flags_t = 1 << 3;
pub const COPYFILE_SECURITY: ::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL;
pub const COPYFILE_METADATA: ::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR;
pub const COPYFILE_RECURSIVE: ::copyfile_flags_t = 1 << 15;
pub const COPYFILE_CHECK: ::copyfile_flags_t = 1 << 16;
pub const COPYFILE_EXCL: ::copyfile_flags_t = 1 << 17;
pub const COPYFILE_NOFOLLOW_SRC: ::copyfile_flags_t = 1 << 18;
pub const COPYFILE_NOFOLLOW_DST: ::copyfile_flags_t = 1 << 19;
pub const COPYFILE_MOVE: ::copyfile_flags_t = 1 << 20;
pub const COPYFILE_UNLINK: ::copyfile_flags_t = 1 << 21;
pub const COPYFILE_NOFOLLOW: ::copyfile_flags_t = COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST;
pub const COPYFILE_PACK: ::copyfile_flags_t = 1 << 22;
pub const COPYFILE_UNPACK: ::copyfile_flags_t = 1 << 23;
pub const COPYFILE_CLONE: ::copyfile_flags_t = 1 << 24;
pub const COPYFILE_CLONE_FORCE: ::copyfile_flags_t = 1 << 25;
pub const COPYFILE_RUN_IN_PLACE: ::copyfile_flags_t = 1 << 26;
pub const COPYFILE_DATA_SPARSE: ::copyfile_flags_t = 1 << 27;
pub const COPYFILE_PRESERVE_DST_TRACKED: ::copyfile_flags_t = 1 << 28;
pub const COPYFILE_VERBOSE: ::copyfile_flags_t = 1 << 30;
pub const COPYFILE_RECURSE_ERROR: ::c_int = 0;
pub const COPYFILE_RECURSE_FILE: ::c_int = 1;
pub const COPYFILE_RECURSE_DIR: ::c_int = 2;
pub const COPYFILE_RECURSE_DIR_CLEANUP: ::c_int = 3;
pub const COPYFILE_COPY_DATA: ::c_int = 4;
pub const COPYFILE_COPY_XATTR: ::c_int = 5;
pub const COPYFILE_START: ::c_int = 1;
pub const COPYFILE_FINISH: ::c_int = 2;
pub const COPYFILE_ERR: ::c_int = 3;
pub const COPYFILE_PROGRESS: ::c_int = 4;
pub const COPYFILE_CONTINUE: ::c_int = 0;
pub const COPYFILE_SKIP: ::c_int = 1;
pub const COPYFILE_QUIT: ::c_int = 2;
pub const COPYFILE_STATE_SRC_FD: ::c_int = 1;
pub const COPYFILE_STATE_SRC_FILENAME: ::c_int = 2;
pub const COPYFILE_STATE_DST_FD: ::c_int = 3;
pub const COPYFILE_STATE_DST_FILENAME: ::c_int = 4;
pub const COPYFILE_STATE_QUARANTINE: ::c_int = 5;
pub const COPYFILE_STATE_STATUS_CB: ::c_int = 6;
pub const COPYFILE_STATE_STATUS_CTX: ::c_int = 7;
pub const COPYFILE_STATE_COPIED: ::c_int = 8;
pub const COPYFILE_STATE_XATTRNAME: ::c_int = 9;
pub const COPYFILE_STATE_WAS_CLONED: ::c_int = 10;
pub const COPYFILE_STATE_SRC_BSIZE: ::c_int = 11;
pub const COPYFILE_STATE_DST_BSIZE: ::c_int = 12;
pub const COPYFILE_STATE_BSIZE: ::c_int = 13;
//
pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5;
pub const FSOPT_NOFOLLOW: u32 = 0x1;
pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800;
pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4;
pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8;
pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20;
pub const FSOPT_RETURN_REALDEV: u32 = 0x200;
pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001;
pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002;
pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004;
pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008;
pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010;
pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020;
pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040;
pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080;
pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100;
pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200;
pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400;
pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800;
pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000;
pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000;
pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000;
pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000;
pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000;
pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000;
pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000;
pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000;
pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000;
pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000;
pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000;
pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000;
pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000;
pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000;
pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000;
pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000;
pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000;
pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000;
pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000;
pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001;
pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002;
pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004;
pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008;
pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010;
pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020;
pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040;
pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080;
pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100;
pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200;
pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400;
pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800;
pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000;
pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000;
pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000;
pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000;
pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000;
pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000;
pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000;
pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000;
pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000;
pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000;
pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000;
pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000;
pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001;
pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002;
pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004;
pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008;
pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010;
pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020;
pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001;
pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002;
pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004;
pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008;
pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020;
pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080;
pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100;
pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200;
pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400;
pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000;
pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000;
pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004;
pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008;
pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010;
pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020;
pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040;
pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080;
pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100;
pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200;
pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400;
pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1;
pub const VOL_CAPABILITIES_FORMAT: usize = 0;
pub const VOL_CAPABILITIES_INTERFACES: usize = 1;
pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001;
pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002;
pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004;
pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008;
pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010;
pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020;
pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040;
pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080;
pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100;
pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200;
pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400;
pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800;
pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000;
pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000;
pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000;
pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000;
pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000;
pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000;
pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000;
pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000;
pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000;
pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000;
pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000;
pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000;
pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000;
pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000;
pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001;
pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002;
pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004;
pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008;
pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010;
pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020;
pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040;
pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080;
pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100;
pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200;
pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400;
pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800;
pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000;
pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000;
pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000;
pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000;
pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000;
pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000;
pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000;
pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000;
//
/// Process being created by fork.
pub const SIDL: u32 = 1;
/// Currently runnable.
pub const SRUN: u32 = 2;
/// Sleeping on an address.
pub const SSLEEP: u32 = 3;
/// Process debugging or suspension.
pub const SSTOP: u32 = 4;
/// Awaiting collection by parent.
pub const SZOMB: u32 = 5;
// sys/vsock.h
pub const VMADDR_CID_ANY: ::c_uint = 0xFFFFFFFF;
pub const VMADDR_CID_HYPERVISOR: ::c_uint = 0;
pub const VMADDR_CID_RESERVED: ::c_uint = 1;
pub const VMADDR_CID_HOST: ::c_uint = 2;
pub const VMADDR_PORT_ANY: ::c_uint = 0xFFFFFFFF;
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
const fn __DARWIN_ALIGN32(p: usize) -> usize {
const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1;
p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
}
} else if #[cfg(libc_const_size_of)] {
fn __DARWIN_ALIGN32(p: usize) -> usize {
const __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1;
p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
}
} else {
fn __DARWIN_ALIGN32(p: usize) -> usize {
let __DARWIN_ALIGNBYTES32: usize = ::mem::size_of::() - 1;
p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32
}
}
}
cfg_if! {
if #[cfg(libc_const_size_of)] {
pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() /
::mem::size_of::()) as mach_msg_type_number_t;
pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t =
(::mem::size_of::() /
::mem::size_of::()) as mach_msg_type_number_t;
pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
pub const TASK_THREAD_TIMES_INFO_COUNT: u32 =
(::mem::size_of::()
/ ::mem::size_of::()) as u32;
pub const MACH_TASK_BASIC_INFO_COUNT: u32 = (::mem::size_of::()
/ ::mem::size_of::()) as u32;
pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t =
(::mem::size_of::() / ::mem::size_of::())
as mach_msg_type_number_t;
} else {
pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = 4;
pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = 1;
pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = 10;
pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = 6;
pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = 28;
pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = 4;
pub const MACH_TASK_BASIC_INFO_COUNT: u32 = 12;
pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = 38;
}
}
f! {
pub fn CMSG_NXTHDR(mhdr: *const ::msghdr,
cmsg: *const ::cmsghdr) -> *mut ::cmsghdr {
if cmsg.is_null() {
return ::CMSG_FIRSTHDR(mhdr);
};
let cmsg_len = (*cmsg).cmsg_len as usize;
let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len as usize);
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next + __DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) > max {
0 as *mut ::cmsghdr
} else {
next as *mut ::cmsghdr
}
}
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) as isize)
}
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>())
+ __DARWIN_ALIGN32(length as usize))
as ::c_uint
}
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(__DARWIN_ALIGN32(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
pub {const} fn VM_MAKE_TAG(id: u8) -> u32 {
(id as u32) << 24u32
}
pub fn major(dev: dev_t) -> i32 {
(dev >> 24) & 0xff
}
pub fn minor(dev: dev_t) -> i32 {
dev & 0xffffff
}
pub fn makedev(major: i32, minor: i32) -> dev_t {
(major << 24) | minor
}
}
safe_f! {
pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
status >> 8
}
pub {const} fn _WSTATUS(status: ::c_int) -> ::c_int {
status & 0x7f
}
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
_WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13
}
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
_WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0
}
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
_WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13
}
}
extern "C" {
pub fn setgrent();
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")]
#[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")]
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
#[doc(hidden)]
#[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")]
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "aio_suspend$UNIX2003"
)]
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn chflags(path: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_uint) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "confstr$UNIX2003"
)]
pub fn confstr(name: ::c_int, buf: *mut ::c_char, len: ::size_t) -> ::size_t;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
pub fn setutxent();
pub fn endutxent();
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
pub fn asctime(tm: *const ::tm) -> *mut ::c_char;
pub fn ctime(clock: *const time_t) -> *mut ::c_char;
pub fn getdate(datestr: *const ::c_char) -> *mut ::tm;
pub fn strptime(
buf: *const ::c_char,
format: *const ::c_char,
timeptr: *mut ::tm,
) -> *mut ::c_char;
pub fn asctime_r(tm: *const ::tm, result: *mut ::c_char) -> *mut ::c_char;
pub fn ctime_r(clock: *const time_t, result: *mut ::c_char) -> *mut ::c_char;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
host: *mut ::c_char,
hostlen: ::socklen_t,
serv: *mut ::c_char,
servlen: ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn sysctlnametomib(
name: *const ::c_char,
mibp: *mut ::c_int,
sizep: *mut ::size_t,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "mprotect$UNIX2003"
)]
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn semget(key: key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "semctl$UNIX2003"
)]
pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::c_int;
pub fn ftok(pathname: *const c_char, proj_id: ::c_int) -> key_t;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "shmctl$UNIX2003"
)]
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn shmget(key: key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn sysctl(
name: *mut ::c_int,
namelen: ::c_uint,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn sysctlbyname(
name: *const ::c_char,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn mach_absolute_time() -> u64;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
#[allow(deprecated)]
pub fn mach_timebase_info(info: *mut ::mach_timebase_info) -> ::c_int;
pub fn mach_host_self() -> mach_port_t;
pub fn mach_thread_self() -> mach_port_t;
pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
pub fn pthread_create_from_mach_thread(
thread: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn pthread_stack_frame_decode_np(
frame_addr: ::uintptr_t,
return_addr: *mut ::uintptr_t,
) -> ::uintptr_t;
pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_condattr_getpshared(
attr: *const pthread_condattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_mutexattr_setpshared(
attr: *mut pthread_mutexattr_t,
pshared: ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_getpshared(
attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_getpshared(
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
pub fn pthread_threadid_np(thread: ::pthread_t, thread_id: *mut u64) -> ::c_int;
pub fn pthread_attr_set_qos_class_np(
attr: *mut pthread_attr_t,
class: qos_class_t,
priority: ::c_int,
) -> ::c_int;
pub fn pthread_attr_get_qos_class_np(
attr: *mut pthread_attr_t,
class: *mut qos_class_t,
priority: *mut ::c_int,
) -> ::c_int;
pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: ::c_int) -> ::c_int;
pub fn pthread_get_qos_class_np(
thread: ::pthread_t,
class: *mut qos_class_t,
priority: *mut ::c_int,
) -> ::c_int;
pub fn pthread_attr_getschedparam(
attr: *const ::pthread_attr_t,
param: *mut sched_param,
) -> ::c_int;
pub fn pthread_attr_setschedparam(
attr: *mut ::pthread_attr_t,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_getschedparam(
thread: ::pthread_t,
policy: *mut ::c_int,
param: *mut sched_param,
) -> ::c_int;
pub fn pthread_setschedparam(
thread: ::pthread_t,
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
// Available from Big Sur
pub fn pthread_introspection_hook_install(
hook: ::pthread_introspection_hook_t,
) -> ::pthread_introspection_hook_t;
pub fn pthread_introspection_setspecific_np(
thread: ::pthread_t,
key: ::pthread_key_t,
value: *const ::c_void,
) -> ::c_int;
pub fn pthread_introspection_getspecific_np(
thread: ::pthread_t,
key: ::pthread_key_t,
) -> *mut ::c_void;
pub fn pthread_jit_write_protect_np(enabled: ::c_int);
pub fn pthread_jit_write_protect_supported_np() -> ::c_int;
// An array of pthread_jit_write_with_callback_np must declare
// the list of callbacks e.g.
// #[link_section = "__DATA_CONST,__pth_jit_func"]
// static callbacks: [libc::pthread_jit_write_callback_t; 2] = [native_jit_write_cb,
// std::mem::transmute::(std::ptr::null())];
// (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages).
pub fn pthread_jit_write_with_callback_np(
callback: ::pthread_jit_write_callback_t,
ctx: *mut ::c_void,
) -> ::c_int;
pub fn pthread_jit_write_freeze_callbacks_np();
pub fn pthread_cpu_number_np(cpu_number_out: *mut ::size_t) -> ::c_int;
pub fn os_unfair_lock_lock(lock: os_unfair_lock_t);
pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool;
pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t);
pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t);
pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t);
pub fn os_log_create(subsystem: *const ::c_char, category: *const ::c_char) -> ::os_log_t;
pub fn os_log_type_enabled(oslog: ::os_log_t, tpe: ::os_log_type_t) -> bool;
pub fn os_signpost_id_make_with_pointer(
log: ::os_log_t,
ptr: *const ::c_void,
) -> ::os_signpost_id_t;
pub fn os_signpost_id_generate(log: ::os_log_t) -> ::os_signpost_id_t;
pub fn os_signpost_enabled(log: ::os_log_t) -> bool;
pub fn thread_policy_set(
thread: thread_t,
flavor: thread_policy_flavor_t,
policy_info: thread_policy_t,
count: mach_msg_type_number_t,
) -> kern_return_t;
pub fn thread_policy_get(
thread: thread_t,
flavor: thread_policy_flavor_t,
policy_info: thread_policy_t,
count: *mut mach_msg_type_number_t,
get_default: *mut boolean_t,
) -> kern_return_t;
pub fn thread_info(
target_act: thread_inspect_t,
flavor: thread_flavor_t,
thread_info_out: thread_info_t,
thread_info_outCnt: *mut mach_msg_type_number_t,
) -> kern_return_t;
#[cfg_attr(doc, doc(alias = "__errno_location"))]
#[cfg_attr(doc, doc(alias = "errno"))]
pub fn __error() -> *mut ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char;
pub fn backtrace_symbols_fd(addrs: *const *mut ::c_void, sz: ::c_int, fd: ::c_int);
pub fn backtrace_from_fp(
startfp: *mut ::c_void,
array: *mut *mut ::c_void,
size: ::c_int,
) -> ::c_int;
pub fn backtrace_image_offsets(
array: *const *mut ::c_void,
image_offsets: *mut image_offset,
size: ::c_int,
);
pub fn backtrace_async(
array: *mut *mut ::c_void,
length: ::size_t,
task_id: *mut u32,
) -> ::size_t;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "statfs$INODE64"
)]
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "fstatfs$INODE64"
)]
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn kevent(
kq: ::c_int,
changelist: *const ::kevent,
nchanges: ::c_int,
eventlist: *mut ::kevent,
nevents: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn kevent64(
kq: ::c_int,
changelist: *const ::kevent64_s,
nchanges: ::c_int,
eventlist: *mut ::kevent64_s,
nevents: ::c_int,
flags: ::c_uint,
timeout: *const ::timespec,
) -> ::c_int;
pub fn mount(
src: *const ::c_char,
target: *const ::c_char,
flags: ::c_int,
data: *mut ::c_void,
) -> ::c_int;
pub fn fmount(
src: *const ::c_char,
fd: ::c_int,
flags: ::c_int,
data: *mut ::c_void,
) -> ::c_int;
pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
pub fn quotactl(
special: *const ::c_char,
cmd: ::c_int,
id: ::c_int,
data: *mut ::c_char,
) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn sendfile(
fd: ::c_int,
s: ::c_int,
offset: ::off_t,
len: *mut ::off_t,
hdtr: *mut ::sf_hdtr,
flags: ::c_int,
) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn openpty(
amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
) -> ::c_int;
pub fn forkpty(
amaster: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
) -> ::pid_t;
pub fn login_tty(fd: ::c_int) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t) -> ::c_int;
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
pub fn getxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *mut ::c_void,
size: ::size_t,
position: u32,
flags: ::c_int,
) -> ::ssize_t;
pub fn fgetxattr(
filedes: ::c_int,
name: *const ::c_char,
value: *mut ::c_void,
size: ::size_t,
position: u32,
flags: ::c_int,
) -> ::ssize_t;
pub fn setxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *const ::c_void,
size: ::size_t,
position: u32,
flags: ::c_int,
) -> ::c_int;
pub fn fsetxattr(
filedes: ::c_int,
name: *const ::c_char,
value: *const ::c_void,
size: ::size_t,
position: u32,
flags: ::c_int,
) -> ::c_int;
pub fn listxattr(
path: *const ::c_char,
list: *mut ::c_char,
size: ::size_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn flistxattr(
filedes: ::c_int,
list: *mut ::c_char,
size: ::size_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn removexattr(path: *const ::c_char, name: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn renamex_np(from: *const ::c_char, to: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn renameatx_np(
fromfd: ::c_int,
from: *const ::c_char,
tofd: ::c_int,
to: *const ::c_char,
flags: ::c_uint,
) -> ::c_int;
pub fn fremovexattr(filedes: ::c_int, name: *const ::c_char, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
name: *const ::c_char,
basegid: ::c_int,
groups: *mut ::c_int,
ngroups: *mut ::c_int,
) -> ::c_int;
pub fn initgroups(user: *const ::c_char, basegroup: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "waitid$UNIX2003"
)]
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
-> ::c_int;
pub fn brk(addr: *const ::c_void) -> *mut ::c_void;
pub fn sbrk(increment: ::c_int) -> *mut ::c_void;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_image_count() -> u32;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
#[allow(deprecated)]
pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> ::intptr_t;
#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")]
pub fn _dyld_get_image_name(image_index: u32) -> *const ::c_char;
pub fn posix_spawn(
pid: *mut ::pid_t,
path: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnp(
pid: *mut ::pid_t,
file: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_getsigdefault(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getflags(
attr: *const posix_spawnattr_t,
flags: *mut ::c_short,
) -> ::c_int;
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
pub fn posix_spawnattr_getpgroup(
attr: *const posix_spawnattr_t,
flags: *mut ::pid_t,
) -> ::c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
pub fn posix_spawnattr_setarchpref_np(
attr: *mut posix_spawnattr_t,
count: ::size_t,
pref: *mut ::cpu_type_t,
subpref: *mut ::cpu_subtype_t,
ocount: *mut ::size_t,
) -> ::c_int;
pub fn posix_spawnattr_getarchpref_np(
attr: *const posix_spawnattr_t,
count: ::size_t,
pref: *mut ::cpu_type_t,
subpref: *mut ::cpu_subtype_t,
ocount: *mut ::size_t,
) -> ::c_int;
pub fn posix_spawnattr_getbinpref_np(
attr: *const posix_spawnattr_t,
count: ::size_t,
pref: *mut ::cpu_type_t,
ocount: *mut ::size_t,
) -> ::c_int;
pub fn posix_spawnattr_setbinpref_np(
attr: *mut posix_spawnattr_t,
count: ::size_t,
pref: *mut ::cpu_type_t,
ocount: *mut ::size_t,
) -> ::c_int;
pub fn posix_spawnattr_set_qos_class_np(
attr: *mut posix_spawnattr_t,
qos_class: ::qos_class_t,
) -> ::c_int;
pub fn posix_spawnattr_get_qos_class_np(
attr: *const posix_spawnattr_t,
qos_class: *mut ::qos_class_t,
) -> ::c_int;
pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_addopen(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
path: *const ::c_char,
oflag: ::c_int,
mode: ::mode_t,
) -> ::c_int;
pub fn posix_spawn_file_actions_addclose(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_adddup2(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn connectx(
socket: ::c_int,
endpoints: *const sa_endpoints_t,
associd: sae_associd_t,
flags: ::c_uint,
iov: *const ::iovec,
iovcnt: ::c_uint,
len: *mut ::size_t,
connid: *mut sae_connid_t,
) -> ::c_int;
pub fn disconnectx(socket: ::c_int, associd: sae_associd_t, connid: sae_connid_t) -> ::c_int;
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "getmntinfo$INODE64"
)]
pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "getfsstat$INODE64"
)]
pub fn getfsstat(mntbufp: *mut statfs, bufsize: ::c_int, flags: ::c_int) -> ::c_int;
// Copy-on-write functions.
// According to the man page `flags` is an `int` but in the header
// this is a `uint32_t`.
pub fn clonefile(src: *const ::c_char, dst: *const ::c_char, flags: u32) -> ::c_int;
pub fn clonefileat(
src_dirfd: ::c_int,
src: *const ::c_char,
dst_dirfd: ::c_int,
dst: *const ::c_char,
flags: u32,
) -> ::c_int;
pub fn fclonefileat(
srcfd: ::c_int,
dst_dirfd: ::c_int,
dst: *const ::c_char,
flags: u32,
) -> ::c_int;
pub fn copyfile(
from: *const ::c_char,
to: *const ::c_char,
state: copyfile_state_t,
flags: copyfile_flags_t,
) -> ::c_int;
pub fn fcopyfile(
from: ::c_int,
to: ::c_int,
state: copyfile_state_t,
flags: copyfile_flags_t,
) -> ::c_int;
pub fn copyfile_state_free(s: copyfile_state_t) -> ::c_int;
pub fn copyfile_state_alloc() -> copyfile_state_t;
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
// Added in macOS 10.13
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
// Added in macOS 10.5
pub fn memset_pattern4(b: *mut ::c_void, pattern4: *const ::c_void, len: ::size_t);
pub fn memset_pattern8(b: *mut ::c_void, pattern8: *const ::c_void, len: ::size_t);
pub fn memset_pattern16(b: *mut ::c_void, pattern16: *const ::c_void, len: ::size_t);
// Inherited from BSD but available from Big Sur only
pub fn strtonum(
__numstr: *const ::c_char,
__minval: ::c_longlong,
__maxval: ::c_longlong,
errstrp: *mut *const ::c_char,
) -> ::c_longlong;
pub fn mstats() -> mstats;
pub fn malloc_printf(format: *const ::c_char, ...);
pub fn malloc_zone_check(zone: *mut ::malloc_zone_t) -> ::boolean_t;
pub fn malloc_zone_print(zone: *mut ::malloc_zone_t, verbose: ::boolean_t);
pub fn malloc_zone_statistics(zone: *mut ::malloc_zone_t, stats: *mut malloc_statistics_t);
pub fn malloc_zone_log(zone: *mut ::malloc_zone_t, address: *mut ::c_void);
pub fn malloc_zone_print_ptr_info(ptr: *mut ::c_void);
pub fn malloc_default_zone() -> *mut ::malloc_zone_t;
pub fn malloc_zone_from_ptr(ptr: *const ::c_void) -> *mut ::malloc_zone_t;
pub fn malloc_zone_malloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
pub fn malloc_zone_valloc(zone: *mut ::malloc_zone_t, size: ::size_t) -> *mut ::c_void;
pub fn malloc_zone_calloc(
zone: *mut ::malloc_zone_t,
num_items: ::size_t,
size: ::size_t,
) -> *mut ::c_void;
pub fn malloc_zone_realloc(
zone: *mut ::malloc_zone_t,
ptr: *mut ::c_void,
size: ::size_t,
) -> *mut ::c_void;
pub fn malloc_zone_free(zone: *mut ::malloc_zone_t, ptr: *mut ::c_void);
pub fn proc_listpids(
t: u32,
typeinfo: u32,
buffer: *mut ::c_void,
buffersize: ::c_int,
) -> ::c_int;
pub fn proc_listallpids(buffer: *mut ::c_void, buffersize: ::c_int) -> ::c_int;
pub fn proc_listpgrppids(
pgrpid: ::pid_t,
buffer: *mut ::c_void,
buffersize: ::c_int,
) -> ::c_int;
pub fn proc_listchildpids(ppid: ::pid_t, buffer: *mut ::c_void, buffersize: ::c_int)
-> ::c_int;
pub fn proc_pidinfo(
pid: ::c_int,
flavor: ::c_int,
arg: u64,
buffer: *mut ::c_void,
buffersize: ::c_int,
) -> ::c_int;
pub fn proc_pidfdinfo(
pid: ::c_int,
fd: ::c_int,
flavor: ::c_int,
buffer: *mut ::c_void,
buffersize: ::c_int,
) -> ::c_int;
pub fn proc_pidfileportinfo(
pid: ::c_int,
fileport: u32,
flavor: ::c_int,
buffer: *mut ::c_void,
buffersize: ::c_int,
) -> ::c_int;
pub fn proc_pidpath(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
pub fn proc_name(pid: ::c_int, buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
pub fn proc_regionfilename(
pid: ::c_int,
address: u64,
buffer: *mut ::c_void,
buffersize: u32,
) -> ::c_int;
pub fn proc_kmsgbuf(buffer: *mut ::c_void, buffersize: u32) -> ::c_int;
pub fn proc_libversion(major: *mut ::c_int, minor: *mut ::c_int) -> ::c_int;
pub fn proc_pid_rusage(pid: ::c_int, flavor: ::c_int, buffer: *mut rusage_info_t) -> ::c_int;
// Available from Big Sur
pub fn proc_set_no_smt() -> ::c_int;
pub fn proc_setthread_no_smt() -> ::c_int;
pub fn proc_set_csm(flags: u32) -> ::c_int;
pub fn proc_setthread_csm(flags: u32) -> ::c_int;
/// # Notes
///
/// `id` is of type [`uuid_t`].
pub fn gethostuuid(id: *mut u8, timeout: *const ::timespec) -> ::c_int;
pub fn gethostid() -> ::c_long;
pub fn sethostid(hostid: ::c_long);
pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int;
pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;
pub fn mach_vm_map(
target_task: ::vm_map_t,
address: *mut ::mach_vm_address_t,
size: ::mach_vm_size_t,
mask: ::mach_vm_offset_t,
flags: ::c_int,
object: ::mem_entry_name_port_t,
offset: ::memory_object_offset_t,
copy: ::boolean_t,
cur_protection: ::vm_prot_t,
max_protection: ::vm_prot_t,
inheritance: ::vm_inherit_t,
) -> ::kern_return_t;
pub fn vm_allocate(
target_task: vm_map_t,
address: *mut vm_address_t,
size: vm_size_t,
flags: ::c_int,
) -> ::kern_return_t;
pub fn vm_deallocate(
target_task: vm_map_t,
address: vm_address_t,
size: vm_size_t,
) -> ::kern_return_t;
pub fn host_statistics64(
host_priv: host_t,
flavor: host_flavor_t,
host_info64_out: host_info64_t,
host_info64_outCnt: *mut mach_msg_type_number_t,
) -> ::kern_return_t;
pub fn host_processor_info(
host: host_t,
flavor: processor_flavor_t,
out_processor_count: *mut natural_t,
out_processor_info: *mut processor_info_array_t,
out_processor_infoCnt: *mut mach_msg_type_number_t,
) -> ::kern_return_t;
pub static mut mach_task_self_: ::mach_port_t;
pub fn task_for_pid(
host: ::mach_port_t,
pid: ::pid_t,
task: *mut ::mach_port_t,
) -> ::kern_return_t;
pub fn task_info(
host: ::mach_port_t,
flavor: task_flavor_t,
task_info_out: task_info_t,
task_info_count: *mut mach_msg_type_number_t,
) -> ::kern_return_t;
pub fn task_create(
target_task: ::task_t,
ledgers: ::ledger_array_t,
ledgersCnt: ::mach_msg_type_number_t,
inherit_memory: ::boolean_t,
child_task: *mut ::task_t,
) -> ::kern_return_t;
pub fn task_terminate(target_task: ::task_t) -> ::kern_return_t;
pub fn task_threads(
target_task: ::task_inspect_t,
act_list: *mut ::thread_act_array_t,
act_listCnt: *mut ::mach_msg_type_number_t,
) -> ::kern_return_t;
pub fn host_statistics(
host_priv: host_t,
flavor: host_flavor_t,
host_info_out: host_info_t,
host_info_outCnt: *mut mach_msg_type_number_t,
) -> ::kern_return_t;
// sysdir.h
pub fn sysdir_start_search_path_enumeration(
dir: sysdir_search_path_directory_t,
domainMask: sysdir_search_path_domain_mask_t,
) -> ::sysdir_search_path_enumeration_state;
pub fn sysdir_get_next_search_path_enumeration(
state: ::sysdir_search_path_enumeration_state,
path: *mut ::c_char,
) -> ::sysdir_search_path_enumeration_state;
pub static vm_page_size: vm_size_t;
pub fn getattrlist(
path: *const ::c_char,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u32,
) -> ::c_int;
pub fn fgetattrlist(
fd: ::c_int,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u32,
) -> ::c_int;
pub fn getattrlistat(
fd: ::c_int,
path: *const ::c_char,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: ::c_ulong,
) -> ::c_int;
pub fn setattrlist(
path: *const ::c_char,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u32,
) -> ::c_int;
pub fn fsetattrlist(
fd: ::c_int,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u32,
) -> ::c_int;
pub fn setattrlistat(
dir_fd: ::c_int,
path: *const ::c_char,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u32,
) -> ::c_int;
pub fn getattrlistbulk(
dirfd: ::c_int,
attrList: *mut ::c_void,
attrBuf: *mut ::c_void,
attrBufSize: ::size_t,
options: u64,
) -> ::c_int;
pub fn malloc_size(ptr: *const ::c_void) -> ::size_t;
pub fn malloc_good_size(size: ::size_t) -> ::size_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn freadlink(fd: ::c_int, buf: *mut ::c_char, size: ::size_t) -> ::c_int;
pub fn execvP(
file: *const ::c_char,
search_path: *const ::c_char,
argv: *const *mut ::c_char,
) -> ::c_int;
}
pub unsafe fn mach_task_self() -> ::mach_port_t {
mach_task_self_
}
cfg_if! {
if #[cfg(target_os = "macos")] {
extern "C" {
pub fn clock_settime(clock_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
}
}
}
cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos"))] {
extern "C" {
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
pub fn task_set_info(target_task: ::task_t,
flavor: ::task_flavor_t,
task_info_in: ::task_info_t,
task_info_inCnt: ::mach_msg_type_number_t
) -> ::kern_return_t;
}
}
}
// These require a dependency on `libiconv`, and including this when built as
// part of `std` means every Rust program gets it. Ideally we would have a link
// modifier to only include these if they are used, but we do not.
#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))]
extern "C" {
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
inbytesleft: *mut ::size_t,
outbuf: *mut *mut ::c_char,
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
}
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
mod b32;
pub use self::b32::*;
} else if #[cfg(target_pointer_width = "64")] {
mod b64;
pub use self::b64::*;
} else {
// Unknown target_arch
}
}
cfg_if! {
if #[cfg(libc_long_array)] {
mod long_array;
pub use self::long_array::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/dragonfly/errno.rs 0000644 0000000 0000000 00000000571 10461020230 0021170 0 ustar 0000000 0000000 // DragonFlyBSD's __error function is declared with "static inline", so it must
// be implemented in the libc crate, as a pointer to a static thread_local.
f! {
#[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")]
pub fn __error() -> *mut ::c_int {
&mut errno
}
}
extern "C" {
#[thread_local]
pub static mut errno: ::c_int;
}
libc-0.2.152/src/unix/bsd/freebsdlike/dragonfly/mod.rs 0000644 0000000 0000000 00000163644 10461020230 0020635 0 ustar 0000000 0000000 pub type dev_t = u32;
pub type c_char = i8;
pub type wchar_t = i32;
pub type clock_t = u64;
pub type ino_t = u64;
pub type lwpid_t = i32;
pub type nlink_t = u32;
pub type blksize_t = i64;
pub type clockid_t = ::c_ulong;
pub type c_long = i64;
pub type c_ulong = u64;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type uuid_t = ::uuid;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
pub type shmatt_t = ::c_uint;
pub type mqd_t = ::c_int;
pub type sem_t = *mut sem;
pub type cpuset_t = cpumask_t;
pub type cpu_set_t = cpumask_t;
pub type register_t = ::c_long;
pub type umtx_t = ::c_int;
pub type pthread_barrierattr_t = ::c_int;
pub type pthread_barrier_t = ::uintptr_t;
pub type pthread_spinlock_t = ::uintptr_t;
pub type segsz_t = usize;
pub type vm_prot_t = u8;
pub type vm_maptype_t = u8;
pub type vm_inherit_t = i8;
pub type vm_subsys_t = ::c_int;
pub type vm_eflags_t = ::c_uint;
pub type vm_map_t = *mut __c_anonymous_vm_map;
pub type vm_map_entry_t = *mut vm_map_entry;
pub type pmap = __c_anonymous_pmap;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
impl ::Copy for sem {}
impl ::Clone for sem {
fn clone(&self) -> sem {
*self
}
}
e! {
#[repr(u32)]
pub enum lwpstat {
LSRUN = 1,
LSSTOP = 2,
LSSLEEP = 3,
}
#[repr(u32)]
pub enum procstat {
SIDL = 1,
SACTIVE = 2,
SSTOP = 3,
SZOMB = 4,
SCORE = 5,
}
}
s! {
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: ::intptr_t,
pub udata: *mut ::c_void,
}
pub struct exit_status {
pub e_termination: u16,
pub e_exit: u16
}
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
pub aio_sigevent: sigevent,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
_aio_val: ::c_int,
_aio_err: ::c_int
}
pub struct uuid {
pub time_low: u32,
pub time_mid: u16,
pub time_hi_and_version: u16,
pub clock_seq_hi_and_reserved: u8,
pub clock_seq_low: u8,
pub node: [u8; 6],
}
pub struct mq_attr {
pub mq_flags: ::c_long,
pub mq_maxmsg: ::c_long,
pub mq_msgsize: ::c_long,
pub mq_curmsgs: ::c_long,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_owner: ::uid_t,
pub f_type: ::c_uint,
pub f_syncreads: u64,
pub f_syncwrites: u64,
pub f_asyncreads: u64,
pub f_asyncwrites: u64,
pub f_fsid_uuid: ::uuid_t,
pub f_uid_uuid: ::uuid_t,
}
pub struct stat {
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_dev: ::dev_t,
pub st_mode: ::mode_t,
pub st_padding1: u16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: i64,
pub __old_st_blksize: u32,
pub st_flags: u32,
pub st_gen: u32,
pub st_lspare: i32,
pub st_blksize: i64,
pub st_qspare2: i64,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_physical: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_recvquota: ::c_uchar,
pub ifi_xmitquota: ::c_uchar,
pub ifi_mtu: ::c_ulong,
pub ifi_metric: ::c_ulong,
pub ifi_link_state: ::c_ulong,
pub ifi_baudrate: u64,
pub ifi_ipackets: ::c_ulong,
pub ifi_ierrors: ::c_ulong,
pub ifi_opackets: ::c_ulong,
pub ifi_oerrors: ::c_ulong,
pub ifi_collisions: ::c_ulong,
pub ifi_ibytes: ::c_ulong,
pub ifi_obytes: ::c_ulong,
pub ifi_imcasts: ::c_ulong,
pub ifi_omcasts: ::c_ulong,
pub ifi_iqdrops: ::c_ulong,
pub ifi_noproto: ::c_ulong,
pub ifi_hwassist: ::c_ulong,
pub ifi_oqdrops: ::c_ulong,
pub ifi_lastchange: ::timeval,
}
pub struct if_msghdr {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 12],
pub sdl_rcf: ::c_ushort,
pub sdl_route: [::c_ushort; 16],
}
pub struct xucred {
pub cr_version: ::c_uint,
pub cr_uid: ::uid_t,
pub cr_ngroups: ::c_short,
pub cr_groups: [::gid_t; 16],
__cr_unused1: *mut ::c_void,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct cpumask_t {
ary: [u64; 4],
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
shm_internal: *mut ::c_void,
}
pub struct kinfo_file {
pub f_size: ::size_t,
pub f_pid: ::pid_t,
pub f_uid: ::uid_t,
pub f_fd: ::c_int,
pub f_file: *mut ::c_void,
pub f_type: ::c_short,
pub f_count: ::c_int,
pub f_msgcount: ::c_int,
pub f_offset: ::off_t,
pub f_data: *mut ::c_void,
pub f_flag: ::c_uint,
}
pub struct kinfo_cputime {
pub cp_user: u64,
pub cp_nice: u64,
pub cp_sys: u64,
pub cp_intr: u64,
pub cp_idel: u64,
cp_unused01: u64,
cp_unused02: u64,
pub cp_sample_pc: u64,
pub cp_sample_sp: u64,
pub cp_msg: [::c_char; 32],
}
pub struct kinfo_lwp {
pub kl_pid: ::pid_t,
pub kl_tid: ::lwpid_t,
pub kl_flags: ::c_int,
pub kl_stat: ::lwpstat,
pub kl_lock: ::c_int,
pub kl_tdflags: ::c_int,
pub kl_mpcount: ::c_int,
pub kl_prio: ::c_int,
pub kl_tdprio: ::c_int,
pub kl_rtprio: ::rtprio,
pub kl_uticks: u64,
pub kl_sticks: u64,
pub kl_iticks: u64,
pub kl_cpticks: u64,
pub kl_pctcpu: ::c_uint,
pub kl_slptime: ::c_uint,
pub kl_origcpu: ::c_int,
pub kl_estcpu: ::c_int,
pub kl_cpuid: ::c_int,
pub kl_ru: ::rusage,
pub kl_siglist: ::sigset_t,
pub kl_sigmask: ::sigset_t,
pub kl_wchan: ::uintptr_t,
pub kl_wmesg: [::c_char; 9],
pub kl_comm: [::c_char; MAXCOMLEN+1],
}
pub struct kinfo_proc {
pub kp_paddr: ::uintptr_t,
pub kp_flags: ::c_int,
pub kp_stat: ::procstat,
pub kp_lock: ::c_int,
pub kp_acflag: ::c_int,
pub kp_traceflag: ::c_int,
pub kp_fd: ::uintptr_t,
pub kp_siglist: ::sigset_t,
pub kp_sigignore: ::sigset_t,
pub kp_sigcatch: ::sigset_t,
pub kp_sigflag: ::c_int,
pub kp_start: ::timeval,
pub kp_comm: [::c_char; MAXCOMLEN+1],
pub kp_uid: ::uid_t,
pub kp_ngroups: ::c_short,
pub kp_groups: [::gid_t; NGROUPS],
pub kp_ruid: ::uid_t,
pub kp_svuid: ::uid_t,
pub kp_rgid: ::gid_t,
pub kp_svgid: ::gid_t,
pub kp_pid: ::pid_t,
pub kp_ppid: ::pid_t,
pub kp_pgid: ::pid_t,
pub kp_jobc: ::c_int,
pub kp_sid: ::pid_t,
pub kp_login: [::c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long)
pub kp_tdev: ::dev_t,
pub kp_tpgid: ::pid_t,
pub kp_tsid: ::pid_t,
pub kp_exitstat: ::c_ushort,
pub kp_nthreads: ::c_int,
pub kp_nice: ::c_int,
pub kp_swtime: ::c_uint,
pub kp_vm_map_size: ::size_t,
pub kp_vm_rssize: ::segsz_t,
pub kp_vm_swrss: ::segsz_t,
pub kp_vm_tsize: ::segsz_t,
pub kp_vm_dsize: ::segsz_t,
pub kp_vm_ssize: ::segsz_t,
pub kp_vm_prssize: ::c_uint,
pub kp_jailid: ::c_int,
pub kp_ru: ::rusage,
pub kp_cru: ::rusage,
pub kp_auxflags: ::c_int,
pub kp_lwp: ::kinfo_lwp,
pub kp_ktaddr: ::uintptr_t,
kp_spare: [::c_int; 2],
}
pub struct __c_anonymous_vm_map {
_priv: [::uintptr_t; 36],
}
pub struct vm_map_entry {
_priv: [::uintptr_t; 15],
pub eflags: ::vm_eflags_t,
pub maptype: ::vm_maptype_t,
pub protection: ::vm_prot_t,
pub max_protection: ::vm_prot_t,
pub inheritance: ::vm_inherit_t,
pub wired_count: ::c_int,
pub id: ::vm_subsys_t,
}
pub struct __c_anonymous_pmap {
_priv1: [::uintptr_t; 32],
_priv2: [::uintptr_t; 32],
_priv3: [::uintptr_t; 32],
_priv4: [::uintptr_t; 32],
_priv5: [::uintptr_t; 8],
}
pub struct vmspace {
vm_map: __c_anonymous_vm_map,
vm_pmap: __c_anonymous_pmap,
pub vm_flags: ::c_int,
pub vm_shm: *mut ::c_char,
pub vm_rssize: ::segsz_t,
pub vm_swrss: ::segsz_t,
pub vm_tsize: ::segsz_t,
pub vm_dsize: ::segsz_t,
pub vm_ssize: ::segsz_t,
pub vm_taddr: *mut ::c_char,
pub vm_daddr: *mut ::c_char,
pub vm_maxsaddr: *mut ::c_char,
pub vm_minsaddr: *mut ::c_char,
_unused1: ::c_int,
_unused2: ::c_int,
pub vm_pagesupply: ::c_int,
pub vm_holdcnt: ::c_uint,
pub vm_refcnt: ::c_uint,
}
pub struct cpuctl_msr_args_t {
pub msr: ::c_int,
pub data: u64,
}
pub struct cpuctl_cpuid_args_t {
pub level: ::c_int,
pub data: [u32; 4],
}
pub struct cpuctl_cpuid_count_args_t {
pub level: ::c_int,
pub level_type: ::c_int,
pub data: [u32; 4],
}
pub struct cpuctl_update_args_t {
pub data: *mut ::c_void,
pub size: ::size_t,
}
}
s_no_extra_traits! {
pub struct utmpx {
pub ut_name: [::c_char; 32],
pub ut_id: [::c_char; 4],
pub ut_line: [::c_char; 32],
pub ut_host: [::c_char; 256],
pub ut_unused: [u8; 16],
pub ut_session: u16,
pub ut_type: u16,
pub ut_pid: ::pid_t,
ut_exit: exit_status,
ut_ss: ::sockaddr_storage,
pub ut_tv: ::timeval,
pub ut_unused2: [u8; 16],
}
pub struct lastlogx {
pub ll_tv: ::timeval,
pub ll_line: [::c_char; _UTX_LINESIZE],
pub ll_host: [::c_char; _UTX_HOSTSIZE],
pub ll_ss: ::sockaddr_storage,
}
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_namlen: u16,
pub d_type: u8,
__unused1: u8,
__unused2: u32,
pub d_name: [::c_char; 256],
}
pub struct statfs {
__spare2: ::c_long,
pub f_bsize: ::c_long,
pub f_iosize: ::c_long,
pub f_blocks: ::c_long,
pub f_bfree: ::c_long,
pub f_bavail: ::c_long,
pub f_files: ::c_long,
pub f_ffree: ::c_long,
pub f_fsid: ::fsid_t,
pub f_owner: ::uid_t,
pub f_type: ::c_int,
pub f_flags: ::c_int,
pub f_syncwrites: ::c_long,
pub f_asyncwrites: ::c_long,
pub f_fstypename: [::c_char; 16],
pub f_mntonname: [::c_char; 80],
pub f_syncreads: ::c_long,
pub f_asyncreads: ::c_long,
__spares1: ::c_short,
pub f_mntfromname: [::c_char; 80],
__spares2: ::c_short,
__spare: [::c_long; 2],
}
pub struct sigevent {
pub sigev_notify: ::c_int,
// The union is 8-byte in size, so it is aligned at a 8-byte offset.
#[cfg(target_pointer_width = "64")]
__unused1: ::c_int,
pub sigev_signo: ::c_int, //actually a union
// pad the union
#[cfg(target_pointer_width = "64")]
__unused2: ::c_int,
pub sigev_value: ::sigval,
__unused3: *mut ::c_void //actually a function pointer
}
pub struct mcontext_t {
pub mc_onstack: register_t,
pub mc_rdi: register_t,
pub mc_rsi: register_t,
pub mc_rdx: register_t,
pub mc_rcx: register_t,
pub mc_r8: register_t,
pub mc_r9: register_t,
pub mc_rax: register_t,
pub mc_rbx: register_t,
pub mc_rbp: register_t,
pub mc_r10: register_t,
pub mc_r11: register_t,
pub mc_r12: register_t,
pub mc_r13: register_t,
pub mc_r14: register_t,
pub mc_r15: register_t,
pub mc_xflags: register_t,
pub mc_trapno: register_t,
pub mc_addr: register_t,
pub mc_flags: register_t,
pub mc_err: register_t,
pub mc_rip: register_t,
pub mc_cs: register_t,
pub mc_rflags: register_t,
pub mc_rsp: register_t,
pub mc_ss: register_t,
pub mc_len: ::c_uint,
pub mc_fpformat: ::c_uint,
pub mc_ownedfp: ::c_uint,
__reserved: ::c_uint,
__unused: [::c_uint; 8],
pub mc_fpregs: [[::c_uint; 8]; 32],
}
pub struct ucontext_t {
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: mcontext_t,
pub uc_link: *mut ucontext_t,
pub uc_stack: stack_t,
pub uc_cofunc: ::Option,
pub uc_arg: *mut ::c_void,
__pad: [::c_int; 4],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for utmpx {
fn eq(&self, other: &utmpx) -> bool {
self.ut_name == other.ut_name
&& self.ut_id == other.ut_id
&& self.ut_line == other.ut_line
&& self
.ut_host
.iter()
.zip(other.ut_host.iter())
.all(|(a,b)| a == b)
&& self.ut_unused == other.ut_unused
&& self.ut_session == other.ut_session
&& self.ut_type == other.ut_type
&& self.ut_pid == other.ut_pid
&& self.ut_exit == other.ut_exit
&& self.ut_ss == other.ut_ss
&& self.ut_tv == other.ut_tv
&& self.ut_unused2 == other.ut_unused2
}
}
impl Eq for utmpx {}
impl ::fmt::Debug for utmpx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utmpx")
.field("ut_name", &self.ut_name)
.field("ut_id", &self.ut_id)
.field("ut_line", &self.ut_line)
// FIXME: .field("ut_host", &self.ut_host)
.field("ut_unused", &self.ut_unused)
.field("ut_session", &self.ut_session)
.field("ut_type", &self.ut_type)
.field("ut_pid", &self.ut_pid)
.field("ut_exit", &self.ut_exit)
.field("ut_ss", &self.ut_ss)
.field("ut_tv", &self.ut_tv)
.field("ut_unused2", &self.ut_unused2)
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash(&self, state: &mut H) {
self.ut_name.hash(state);
self.ut_id.hash(state);
self.ut_line.hash(state);
self.ut_host.hash(state);
self.ut_unused.hash(state);
self.ut_session.hash(state);
self.ut_type.hash(state);
self.ut_pid.hash(state);
self.ut_exit.hash(state);
self.ut_ss.hash(state);
self.ut_tv.hash(state);
self.ut_unused2.hash(state);
}
}
impl PartialEq for lastlogx {
fn eq(&self, other: &lastlogx) -> bool {
self.ll_tv == other.ll_tv
&& self.ll_line == other.ll_line
&& self.ll_host == other.ll_host
&& self.ll_ss == other.ll_ss
}
}
impl Eq for lastlogx {}
impl ::fmt::Debug for lastlogx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("lastlogx")
.field("ll_tv", &self.ll_tv)
.field("ll_line", &self.ll_line)
.field("ll_host", &self.ll_host)
.field("ll_ss", &self.ll_ss)
.finish()
}
}
impl ::hash::Hash for lastlogx {
fn hash(&self, state: &mut H) {
self.ll_tv.hash(state);
self.ll_line.hash(state);
self.ll_host.hash(state);
self.ll_ss.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_namlen == other.d_namlen
&& self.d_type == other.d_type
// Ignore __unused1
// Ignore __unused2
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_namlen", &self.d_namlen)
.field("d_type", &self.d_type)
// Ignore __unused1
// Ignore __unused2
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_namlen.hash(state);
self.d_type.hash(state);
// Ignore __unused1
// Ignore __unused2
self.d_name.hash(state);
}
}
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_fsid == other.f_fsid
&& self.f_owner == other.f_owner
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_fsid", &self.f_fsid)
.field("f_owner", &self.f_owner)
.field("f_type", &self.f_type)
.field("f_flags", &self.f_flags)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
// FIXME: .field("f_mntonname", &self.f_mntonname)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
// FIXME: .field("f_mntfromname", &self.f_mntfromname)
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_fsid.hash(state);
self.f_owner.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_fstypename.hash(state);
self.f_mntonname.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_mntfromname.hash(state);
}
}
impl PartialEq for sigevent {
fn eq(&self, other: &sigevent) -> bool {
self.sigev_notify == other.sigev_notify
&& self.sigev_signo == other.sigev_signo
&& self.sigev_value == other.sigev_value
}
}
impl Eq for sigevent {}
impl ::fmt::Debug for sigevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigevent")
.field("sigev_notify", &self.sigev_notify)
.field("sigev_signo", &self.sigev_signo)
.field("sigev_value", &self.sigev_value)
.finish()
}
}
impl ::hash::Hash for sigevent {
fn hash(&self, state: &mut H) {
self.sigev_notify.hash(state);
self.sigev_signo.hash(state);
self.sigev_value.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_onstack == other.mc_onstack &&
self.mc_rdi == other.mc_rdi &&
self.mc_rsi == other.mc_rsi &&
self.mc_rdx == other.mc_rdx &&
self.mc_rcx == other.mc_rcx &&
self.mc_r8 == other.mc_r8 &&
self.mc_r9 == other.mc_r9 &&
self.mc_rax == other.mc_rax &&
self.mc_rbx == other.mc_rbx &&
self.mc_rbp == other.mc_rbp &&
self.mc_r10 == other.mc_r10 &&
self.mc_r11 == other.mc_r11 &&
self.mc_r12 == other.mc_r12 &&
self.mc_r13 == other.mc_r13 &&
self.mc_r14 == other.mc_r14 &&
self.mc_r15 == other.mc_r15 &&
self.mc_xflags == other.mc_xflags &&
self.mc_trapno == other.mc_trapno &&
self.mc_addr == other.mc_addr &&
self.mc_flags == other.mc_flags &&
self.mc_err == other.mc_err &&
self.mc_rip == other.mc_rip &&
self.mc_cs == other.mc_cs &&
self.mc_rflags == other.mc_rflags &&
self.mc_rsp == other.mc_rsp &&
self.mc_ss == other.mc_ss &&
self.mc_len == other.mc_len &&
self.mc_fpformat == other.mc_fpformat &&
self.mc_ownedfp == other.mc_ownedfp &&
self.mc_fpregs.iter().zip(other.mc_fpregs.iter()).
all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_onstack", &self.mc_onstack)
.field("mc_rdi", &self.mc_rdi)
.field("mc_rsi", &self.mc_rsi)
.field("mc_rdx", &self.mc_rdx)
.field("mc_rcx", &self.mc_rcx)
.field("mc_r8", &self.mc_r8)
.field("mc_r9", &self.mc_r9)
.field("mc_rax", &self.mc_rax)
.field("mc_rbx", &self.mc_rbx)
.field("mc_rbp", &self.mc_rbp)
.field("mc_r10", &self.mc_r10)
.field("mc_r11", &self.mc_r11)
.field("mc_r12", &self.mc_r12)
.field("mc_r13", &self.mc_r13)
.field("mc_r14", &self.mc_r14)
.field("mc_r15", &self.mc_r15)
.field("mc_xflags", &self.mc_xflags)
.field("mc_trapno", &self.mc_trapno)
.field("mc_addr", &self.mc_addr)
.field("mc_flags", &self.mc_flags)
.field("mc_err", &self.mc_err)
.field("mc_rip", &self.mc_rip)
.field("mc_cs", &self.mc_cs)
.field("mc_rflags", &self.mc_rflags)
.field("mc_rsp", &self.mc_rsp)
.field("mc_ss", &self.mc_ss)
.field("mc_len", &self.mc_len)
.field("mc_fpformat", &self.mc_fpformat)
.field("mc_ownedfp", &self.mc_ownedfp)
.field("mc_fpregs", &self.mc_fpregs)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash(&self, state: &mut H) {
self.mc_onstack.hash(state);
self.mc_rdi.hash(state);
self.mc_rsi.hash(state);
self.mc_rdx.hash(state);
self.mc_rcx.hash(state);
self.mc_r8.hash(state);
self.mc_r9.hash(state);
self.mc_rax.hash(state);
self.mc_rbx.hash(state);
self.mc_rbp.hash(state);
self.mc_r10.hash(state);
self.mc_r11.hash(state);
self.mc_r10.hash(state);
self.mc_r11.hash(state);
self.mc_r12.hash(state);
self.mc_r13.hash(state);
self.mc_r14.hash(state);
self.mc_r15.hash(state);
self.mc_xflags.hash(state);
self.mc_trapno.hash(state);
self.mc_addr.hash(state);
self.mc_flags.hash(state);
self.mc_err.hash(state);
self.mc_rip.hash(state);
self.mc_cs.hash(state);
self.mc_rflags.hash(state);
self.mc_rsp.hash(state);
self.mc_ss.hash(state);
self.mc_len.hash(state);
self.mc_fpformat.hash(state);
self.mc_ownedfp.hash(state);
self.mc_fpregs.hash(state);
}
}
impl PartialEq for ucontext_t {
fn eq(&self, other: &ucontext_t) -> bool {
self.uc_sigmask == other.uc_sigmask
&& self.uc_mcontext == other.uc_mcontext
&& self.uc_link == other.uc_link
&& self.uc_stack == other.uc_stack
&& self.uc_cofunc == other.uc_cofunc
&& self.uc_arg == other.uc_arg
}
}
impl Eq for ucontext_t {}
impl ::fmt::Debug for ucontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ucontext_t")
.field("uc_sigmask", &self.uc_sigmask)
.field("uc_mcontext", &self.uc_mcontext)
.field("uc_link", &self.uc_link)
.field("uc_stack", &self.uc_stack)
.field("uc_cofunc", &self.uc_cofunc)
.field("uc_arg", &self.uc_arg)
.finish()
}
}
impl ::hash::Hash for ucontext_t {
fn hash(&self, state: &mut H) {
self.uc_sigmask.hash(state);
self.uc_mcontext.hash(state);
self.uc_link.hash(state);
self.uc_stack.hash(state);
self.uc_cofunc.hash(state);
self.uc_arg.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const PTHREAD_STACK_MIN: ::size_t = 16384;
pub const SIGSTKSZ: ::size_t = 40960;
pub const SIGCKPT: ::c_int = 33;
pub const SIGCKPTEXIT: ::c_int = 34;
pub const CKPT_FREEZE: ::c_int = 0x1;
pub const CKPT_THAW: ::c_int = 0x2;
pub const MADV_INVAL: ::c_int = 10;
pub const MADV_SETMAP: ::c_int = 11;
pub const O_CLOEXEC: ::c_int = 0x00020000;
pub const O_DIRECTORY: ::c_int = 0x08000000;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const F_GETPATH: ::c_int = 19;
pub const ENOMEDIUM: ::c_int = 93;
pub const ENOTRECOVERABLE: ::c_int = 94;
pub const EOWNERDEAD: ::c_int = 95;
pub const EASYNC: ::c_int = 99;
pub const ELAST: ::c_int = 99;
pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::rlim_t = 12;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
pub const CTL_NET: ::c_int = 4;
pub const CTL_DEBUG: ::c_int = 5;
pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_P1003_1B: ::c_int = 9;
pub const CTL_LWKT: ::c_int = 10;
pub const CTL_MAXID: ::c_int = 11;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
pub const KERN_VERSION: ::c_int = 4;
pub const KERN_MAXVNODES: ::c_int = 5;
pub const KERN_MAXPROC: ::c_int = 6;
pub const KERN_MAXFILES: ::c_int = 7;
pub const KERN_ARGMAX: ::c_int = 8;
pub const KERN_SECURELVL: ::c_int = 9;
pub const KERN_HOSTNAME: ::c_int = 10;
pub const KERN_HOSTID: ::c_int = 11;
pub const KERN_CLOCKRATE: ::c_int = 12;
pub const KERN_VNODE: ::c_int = 13;
pub const KERN_PROC: ::c_int = 14;
pub const KERN_FILE: ::c_int = 15;
pub const KERN_PROF: ::c_int = 16;
pub const KERN_POSIX1: ::c_int = 17;
pub const KERN_NGROUPS: ::c_int = 18;
pub const KERN_JOB_CONTROL: ::c_int = 19;
pub const KERN_SAVED_IDS: ::c_int = 20;
pub const KERN_BOOTTIME: ::c_int = 21;
pub const KERN_NISDOMAINNAME: ::c_int = 22;
pub const KERN_UPDATEINTERVAL: ::c_int = 23;
pub const KERN_OSRELDATE: ::c_int = 24;
pub const KERN_NTP_PLL: ::c_int = 25;
pub const KERN_BOOTFILE: ::c_int = 26;
pub const KERN_MAXFILESPERPROC: ::c_int = 27;
pub const KERN_MAXPROCPERUID: ::c_int = 28;
pub const KERN_DUMPDEV: ::c_int = 29;
pub const KERN_IPC: ::c_int = 30;
pub const KERN_DUMMY: ::c_int = 31;
pub const KERN_PS_STRINGS: ::c_int = 32;
pub const KERN_USRSTACK: ::c_int = 33;
pub const KERN_LOGSIGEXIT: ::c_int = 34;
pub const KERN_IOV_MAX: ::c_int = 35;
pub const KERN_MAXPOSIXLOCKSPERUID: ::c_int = 36;
pub const KERN_MAXID: ::c_int = 37;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
pub const KERN_PROC_SESSION: ::c_int = 3;
pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_ARGS: ::c_int = 7;
pub const KERN_PROC_CWD: ::c_int = 8;
pub const KERN_PROC_PATHNAME: ::c_int = 9;
pub const KERN_PROC_FLAGMASK: ::c_int = 0x10;
pub const KERN_PROC_FLAG_LWP: ::c_int = 0x10;
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
pub const KIPC_MAX_LINKHDR: ::c_int = 4;
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
pub const KIPC_MAX_HDR: ::c_int = 6;
pub const KIPC_MAX_DATALEN: ::c_int = 7;
pub const KIPC_MBSTAT: ::c_int = 8;
pub const KIPC_NMBCLUSTERS: ::c_int = 9;
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
pub const HW_BYTEORDER: ::c_int = 4;
pub const HW_PHYSMEM: ::c_int = 5;
pub const HW_USERMEM: ::c_int = 6;
pub const HW_PAGESIZE: ::c_int = 7;
pub const HW_DISKNAMES: ::c_int = 8;
pub const HW_DISKSTATS: ::c_int = 9;
pub const HW_FLOATINGPT: ::c_int = 10;
pub const HW_MACHINE_ARCH: ::c_int = 11;
pub const HW_MACHINE_PLATFORM: ::c_int = 12;
pub const HW_SENSORS: ::c_int = 13;
pub const HW_MAXID: ::c_int = 14;
pub const USER_CS_PATH: ::c_int = 1;
pub const USER_BC_BASE_MAX: ::c_int = 2;
pub const USER_BC_DIM_MAX: ::c_int = 3;
pub const USER_BC_SCALE_MAX: ::c_int = 4;
pub const USER_BC_STRING_MAX: ::c_int = 5;
pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
pub const USER_EXPR_NEST_MAX: ::c_int = 7;
pub const USER_LINE_MAX: ::c_int = 8;
pub const USER_RE_DUP_MAX: ::c_int = 9;
pub const USER_POSIX2_VERSION: ::c_int = 10;
pub const USER_POSIX2_C_BIND: ::c_int = 11;
pub const USER_POSIX2_C_DEV: ::c_int = 12;
pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
pub const USER_POSIX2_SW_DEV: ::c_int = 17;
pub const USER_POSIX2_UPE: ::c_int = 18;
pub const USER_STREAM_MAX: ::c_int = 19;
pub const USER_TZNAME_MAX: ::c_int = 20;
pub const USER_MAXID: ::c_int = 21;
pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
pub const CTL_P1003_1B_UNUSED1: ::c_int = 19;
pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
pub const CTL_P1003_1B_MAXID: ::c_int = 26;
pub const CPUCTL_RSMSR: ::c_int = 0xc0106301;
pub const CPUCTL_WRMSR: ::c_int = 0xc0106302;
pub const CPUCTL_CPUID: ::c_int = 0xc0106303;
pub const CPUCTL_UPDATE: ::c_int = 0xc0106304;
pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305;
pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306;
pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307;
pub const CPU_SETSIZE: ::size_t = ::mem::size_of::<::cpumask_t>() * 8;
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
pub const EVFILT_EXCEPT: i16 = -8;
pub const EVFILT_USER: i16 = -9;
pub const EVFILT_FS: i16 = -10;
pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
pub const EV_NODATA: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_ERROR: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
pub const EV_HUP: u16 = 0x8000;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const FIODNAME: ::c_ulong = 0x80106678;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
pub const NOTE_FFOR: u32 = 0x80000000;
pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_OOB: u32 = 0x00000002;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
pub const NOTE_PDATAMASK: u32 = 0x000fffff;
pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
pub const SO_SNDSPACE: ::c_int = 0x100a;
pub const SO_CPUHINT: ::c_int = 0x1030;
pub const SO_PASSCRED: ::c_int = 0x4000;
pub const PT_FIRSTMACH: ::c_int = 32;
pub const PROC_REAP_ACQUIRE: ::c_int = 0x0001;
pub const PROC_REAP_RELEASE: ::c_int = 0x0002;
pub const PROC_REAP_STATUS: ::c_int = 0x0003;
pub const PROC_PDEATHSIG_CTL: ::c_int = 0x0004;
pub const PROC_PDEATHSIG_STATUS: ::c_int = 0x0005;
// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/HEAD/sys/net/if.h#L101
pub const IFF_UP: ::c_int = 0x1; // interface is up
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
pub const IFF_SMART: ::c_int = 0x20; // interface manages own routes
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
pub const IFF_OACTIVE_COMPAT: ::c_int = 0x400; // was transmission in progress
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2; // use alternate physical connection
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
// was interface is in polling mode
pub const IFF_POLLING_COMPAT: ::c_int = 0x10000;
pub const IFF_PPROMISC: ::c_int = 0x20000; // user-requested promisc mode
pub const IFF_MONITOR: ::c_int = 0x40000; // user-requested monitor mode
pub const IFF_STATICARP: ::c_int = 0x80000; // static ARP
pub const IFF_NPOLLING: ::c_int = 0x100000; // interface is in polling mode
pub const IFF_IDIRECT: ::c_int = 0x200000; // direct input
//
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// IP6 hop-by-hop options
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// gateway^2 (deprecated)
pub const IPPROTO_GGP: ::c_int = 3;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// Stream protocol II.
pub const IPPROTO_ST: ::c_int = 7;
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// private interior gateway
pub const IPPROTO_PIGP: ::c_int = 9;
/// BBN RCC Monitoring
pub const IPPROTO_RCCMON: ::c_int = 10;
/// network voice protocol
pub const IPPROTO_NVPII: ::c_int = 11;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
/// Argus
pub const IPPROTO_ARGUS: ::c_int = 13;
/// EMCON
pub const IPPROTO_EMCON: ::c_int = 14;
/// Cross Net Debugger
pub const IPPROTO_XNET: ::c_int = 15;
/// Chaos
pub const IPPROTO_CHAOS: ::c_int = 16;
// IPPROTO_UDP defined in src/unix/mod.rs
/// Multiplexing
pub const IPPROTO_MUX: ::c_int = 18;
/// DCN Measurement Subsystems
pub const IPPROTO_MEAS: ::c_int = 19;
/// Host Monitoring
pub const IPPROTO_HMP: ::c_int = 20;
/// Packet Radio Measurement
pub const IPPROTO_PRM: ::c_int = 21;
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// Trunk-1
pub const IPPROTO_TRUNK1: ::c_int = 23;
/// Trunk-2
pub const IPPROTO_TRUNK2: ::c_int = 24;
/// Leaf-1
pub const IPPROTO_LEAF1: ::c_int = 25;
/// Leaf-2
pub const IPPROTO_LEAF2: ::c_int = 26;
/// Reliable Data
pub const IPPROTO_RDP: ::c_int = 27;
/// Reliable Transaction
pub const IPPROTO_IRTP: ::c_int = 28;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// Bulk Data Transfer
pub const IPPROTO_BLT: ::c_int = 30;
/// Network Services
pub const IPPROTO_NSP: ::c_int = 31;
/// Merit Internodal
pub const IPPROTO_INP: ::c_int = 32;
/// Sequential Exchange
pub const IPPROTO_SEP: ::c_int = 33;
/// Third Party Connect
pub const IPPROTO_3PC: ::c_int = 34;
/// InterDomain Policy Routing
pub const IPPROTO_IDPR: ::c_int = 35;
/// XTP
pub const IPPROTO_XTP: ::c_int = 36;
/// Datagram Delivery
pub const IPPROTO_DDP: ::c_int = 37;
/// Control Message Transport
pub const IPPROTO_CMTP: ::c_int = 38;
/// TP++ Transport
pub const IPPROTO_TPXX: ::c_int = 39;
/// IL transport protocol
pub const IPPROTO_IL: ::c_int = 40;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// Source Demand Routing
pub const IPPROTO_SDRP: ::c_int = 42;
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// InterDomain Routing
pub const IPPROTO_IDRP: ::c_int = 45;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// Mobile Host Routing
pub const IPPROTO_MHRP: ::c_int = 48;
/// BHA
pub const IPPROTO_BHA: ::c_int = 49;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
/// Integ. Net Layer Security
pub const IPPROTO_INLSP: ::c_int = 52;
/// IP with encryption
pub const IPPROTO_SWIPE: ::c_int = 53;
/// Next Hop Resolution
pub const IPPROTO_NHRP: ::c_int = 54;
/// IP Mobility
pub const IPPROTO_MOBILE: ::c_int = 55;
/// Transport Layer Security
pub const IPPROTO_TLSP: ::c_int = 56;
/// SKIP
pub const IPPROTO_SKIP: ::c_int = 57;
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
/// any host internal protocol
pub const IPPROTO_AHIP: ::c_int = 61;
/// CFTP
pub const IPPROTO_CFTP: ::c_int = 62;
/// "hello" routing protocol
pub const IPPROTO_HELLO: ::c_int = 63;
/// SATNET/Backroom EXPAK
pub const IPPROTO_SATEXPAK: ::c_int = 64;
/// Kryptolan
pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
/// Remote Virtual Disk
pub const IPPROTO_RVD: ::c_int = 66;
/// Pluribus Packet Core
pub const IPPROTO_IPPC: ::c_int = 67;
/// Any distributed FS
pub const IPPROTO_ADFS: ::c_int = 68;
/// Satnet Monitoring
pub const IPPROTO_SATMON: ::c_int = 69;
/// VISA Protocol
pub const IPPROTO_VISA: ::c_int = 70;
/// Packet Core Utility
pub const IPPROTO_IPCV: ::c_int = 71;
/// Comp. Prot. Net. Executive
pub const IPPROTO_CPNX: ::c_int = 72;
/// Comp. Prot. HeartBeat
pub const IPPROTO_CPHB: ::c_int = 73;
/// Wang Span Network
pub const IPPROTO_WSN: ::c_int = 74;
/// Packet Video Protocol
pub const IPPROTO_PVP: ::c_int = 75;
/// BackRoom SATNET Monitoring
pub const IPPROTO_BRSATMON: ::c_int = 76;
/// Sun net disk proto (temp.)
pub const IPPROTO_ND: ::c_int = 77;
/// WIDEBAND Monitoring
pub const IPPROTO_WBMON: ::c_int = 78;
/// WIDEBAND EXPAK
pub const IPPROTO_WBEXPAK: ::c_int = 79;
/// ISO cnlp
pub const IPPROTO_EON: ::c_int = 80;
/// VMTP
pub const IPPROTO_VMTP: ::c_int = 81;
/// Secure VMTP
pub const IPPROTO_SVMTP: ::c_int = 82;
/// Banyon VINES
pub const IPPROTO_VINES: ::c_int = 83;
/// TTP
pub const IPPROTO_TTP: ::c_int = 84;
/// NSFNET-IGP
pub const IPPROTO_IGP: ::c_int = 85;
/// dissimilar gateway prot.
pub const IPPROTO_DGP: ::c_int = 86;
/// TCF
pub const IPPROTO_TCF: ::c_int = 87;
/// Cisco/GXS IGRP
pub const IPPROTO_IGRP: ::c_int = 88;
/// OSPFIGP
pub const IPPROTO_OSPFIGP: ::c_int = 89;
/// Strite RPC protocol
pub const IPPROTO_SRPC: ::c_int = 90;
/// Locus Address Resoloution
pub const IPPROTO_LARP: ::c_int = 91;
/// Multicast Transport
pub const IPPROTO_MTP: ::c_int = 92;
/// AX.25 Frames
pub const IPPROTO_AX25: ::c_int = 93;
/// IP encapsulated in IP
pub const IPPROTO_IPEIP: ::c_int = 94;
/// Mobile Int.ing control
pub const IPPROTO_MICP: ::c_int = 95;
/// Semaphore Comm. security
pub const IPPROTO_SCCSP: ::c_int = 96;
/// Ethernet IP encapsulation
pub const IPPROTO_ETHERIP: ::c_int = 97;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// any private encr. scheme
pub const IPPROTO_APES: ::c_int = 99;
/// GMTP
pub const IPPROTO_GMTP: ::c_int = 100;
/// payload compression (IPComp)
pub const IPPROTO_IPCOMP: ::c_int = 108;
/* 101-254: Partly Unassigned */
/// Protocol Independent Mcast
pub const IPPROTO_PIM: ::c_int = 103;
/// CARP
pub const IPPROTO_CARP: ::c_int = 112;
/// PGM
pub const IPPROTO_PGM: ::c_int = 113;
/// PFSYNC
pub const IPPROTO_PFSYNC: ::c_int = 240;
/* 255: Reserved */
/* BSD Private, local use, namespace incursion, no longer used */
/// divert pseudo-protocol
pub const IPPROTO_DIVERT: ::c_int = 254;
pub const IPPROTO_MAX: ::c_int = 256;
/// last return value of *_input(), meaning "all job for this pkt is done".
pub const IPPROTO_DONE: ::c_int = 257;
/// Used by RSS: the layer3 protocol is unknown
pub const IPPROTO_UNKNOWN: ::c_int = 258;
// sys/netinet/tcp.h
pub const TCP_SIGNATURE_ENABLE: ::c_int = 16;
pub const TCP_KEEPINIT: ::c_int = 32;
pub const TCP_FASTKEEP: ::c_int = 128;
pub const AF_BLUETOOTH: ::c_int = 33;
pub const AF_MPLS: ::c_int = 34;
pub const AF_IEEE80211: ::c_int = 35;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
pub const NET_RT_IFLIST: ::c_int = 3;
pub const NET_RT_MAXID: ::c_int = 4;
pub const SOMAXOPT_SIZE: ::c_int = 65536;
pub const MSG_UNUSED09: ::c_int = 0x00000200;
pub const MSG_NOSIGNAL: ::c_int = 0x00000400;
pub const MSG_SYNC: ::c_int = 0x00000800;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00001000;
pub const MSG_FBLOCKING: ::c_int = 0x00010000;
pub const MSG_FNONBLOCKING: ::c_int = 0x00020000;
pub const MSG_FMASK: ::c_int = 0xFFFF0000;
// sys/mount.h
pub const MNT_NODEV: ::c_int = 0x00000010;
pub const MNT_AUTOMOUNTED: ::c_int = 0x00000020;
pub const MNT_TRIM: ::c_int = 0x01000000;
pub const MNT_LOCAL: ::c_int = 0x00001000;
pub const MNT_QUOTA: ::c_int = 0x00002000;
pub const MNT_ROOTFS: ::c_int = 0x00004000;
pub const MNT_USER: ::c_int = 0x00008000;
pub const MNT_IGNORE: ::c_int = 0x00800000;
// utmpx entry types
pub const EMPTY: ::c_short = 0;
pub const RUN_LVL: ::c_short = 1;
pub const BOOT_TIME: ::c_short = 2;
pub const OLD_TIME: ::c_short = 3;
pub const NEW_TIME: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const USER_PROCESS: ::c_short = 7;
pub const DEAD_PROCESS: ::c_short = 8;
pub const ACCOUNTING: ::c_short = 9;
pub const SIGNATURE: ::c_short = 10;
pub const DOWNTIME: ::c_short = 11;
// utmpx database types
pub const UTX_DB_UTMPX: ::c_uint = 0;
pub const UTX_DB_WTMPX: ::c_uint = 1;
pub const UTX_DB_LASTLOG: ::c_uint = 2;
pub const _UTX_LINESIZE: usize = 32;
pub const _UTX_USERSIZE: usize = 32;
pub const _UTX_IDSIZE: usize = 4;
pub const _UTX_HOSTSIZE: usize = 256;
pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
pub const LC_TIME_MASK: ::c_int = 1 << 4;
pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
| LC_CTYPE_MASK
| LC_MESSAGES_MASK
| LC_MONETARY_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK;
pub const TIOCSIG: ::c_ulong = 0x2000745f;
pub const BTUARTDISC: ::c_int = 0x7;
pub const TIOCDCDTIMESTAMP: ::c_ulong = 0x40107458;
pub const TIOCISPTMASTER: ::c_ulong = 0x20007455;
pub const TIOCMODG: ::c_ulong = 0x40047403;
pub const TIOCMODS: ::c_ulong = 0x80047404;
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
// Constants used by "at" family of system calls.
pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 1;
pub const AT_REMOVEDIR: ::c_int = 2;
pub const AT_EACCESS: ::c_int = 4;
pub const AT_SYMLINK_FOLLOW: ::c_int = 8;
pub const VCHECKPT: usize = 19;
pub const _PC_2_SYMLINKS: ::c_int = 22;
pub const _PC_TIMESTAMP_RESOLUTION: ::c_int = 23;
pub const _SC_V7_ILP32_OFF32: ::c_int = 122;
pub const _SC_V7_ILP32_OFFBIG: ::c_int = 123;
pub const _SC_V7_LP64_OFF64: ::c_int = 124;
pub const _SC_V7_LPBIG_OFFBIG: ::c_int = 125;
pub const _SC_THREAD_ROBUST_PRIO_INHERIT: ::c_int = 126;
pub const _SC_THREAD_ROBUST_PRIO_PROTECT: ::c_int = 127;
pub const WCONTINUED: ::c_int = 0x4;
pub const WSTOPPED: ::c_int = 0x2;
pub const WNOWAIT: ::c_int = 0x8;
pub const WEXITED: ::c_int = 0x10;
pub const WTRAPPED: ::c_int = 0x20;
// Similar to FreeBSD, only the standardized ones are exposed.
// There are more.
pub const P_PID: idtype_t = 0;
pub const P_PGID: idtype_t = 2;
pub const P_ALL: idtype_t = 7;
// Values for struct rtprio (type_ field)
pub const RTP_PRIO_REALTIME: ::c_ushort = 0;
pub const RTP_PRIO_NORMAL: ::c_ushort = 1;
pub const RTP_PRIO_IDLE: ::c_ushort = 2;
pub const RTP_PRIO_THREAD: ::c_ushort = 3;
// Flags for chflags(2)
pub const UF_NOHISTORY: ::c_ulong = 0x00000040;
pub const UF_CACHE: ::c_ulong = 0x00000080;
pub const UF_XLINK: ::c_ulong = 0x00000100;
pub const SF_NOHISTORY: ::c_ulong = 0x00400000;
pub const SF_CACHE: ::c_ulong = 0x00800000;
pub const SF_XLINK: ::c_ulong = 0x01000000;
// timespec constants
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;
pub const MINCORE_SUPER: ::c_int = 0x20;
// kinfo_proc constants
pub const MAXCOMLEN: usize = 16;
pub const MAXLOGNAME: usize = 33;
pub const NGROUPS: usize = 16;
pub const RB_PAUSE: ::c_int = 0x40000;
pub const RB_VIDEO: ::c_int = 0x20000000;
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
}
}
f! {
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) + length as usize)
as ::c_uint
}
pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
-> *mut ::cmsghdr
{
let next = cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)
+ _CMSG_ALIGN(::mem::size_of::<::cmsghdr>());
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next <= max {
(cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize))
as *mut ::cmsghdr
} else {
0 as *mut ::cmsghdr
}
}
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
(_CMSG_ALIGN(::mem::size_of::<::cmsghdr>()) +
_CMSG_ALIGN(length as usize)) as ::c_uint
}
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.ary.iter_mut() {
*slot = 0;
}
}
pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () {
let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
cpuset.ary[idx] |= 1 << offset;
()
}
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () {
let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
cpuset.ary[idx] &= !(1 << offset);
()
}
pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool {
let (idx, offset) = ((cpu >> 6) & 3, cpu & 63);
0 != cpuset.ary[idx] & (1 << offset)
}
pub fn major(dev: ::dev_t) -> ::c_int {
((dev >> 8) & 0xff) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(dev & 0xffff00ff) as ::c_int
}
}
safe_f! {
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
(status & 0o177) != 0o177 && (status & 0o177) != 0
}
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= major << 8;
dev |= minor;
dev
}
}
extern "C" {
pub fn __errno_location() -> *mut ::c_int;
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn setutxdb(_type: ::c_uint, file: *mut ::c_char) -> ::c_int;
pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::c_int;
pub fn devname_r(
dev: ::dev_t,
mode: ::mode_t,
buf: *mut ::c_char,
len: ::size_t,
) -> *mut ::c_char;
pub fn waitid(
idtype: idtype_t,
id: ::id_t,
infop: *mut ::siginfo_t,
options: ::c_int,
) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn lwp_rtprio(
function: ::c_int,
pid: ::pid_t,
lwpid: lwpid_t,
rtp: *mut super::rtprio,
) -> ::c_int;
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn sched_getaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *mut cpu_set_t) -> ::c_int;
pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t)
-> ::c_int;
pub fn sched_getcpu() -> ::c_int;
pub fn setproctitle(fmt: *const ::c_char, ...);
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
pub fn getutxuser(name: *const ::c_char) -> utmpx;
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
pub fn sys_checkpoint(tpe: ::c_int, fd: ::c_int, pid: ::pid_t, retval: ::c_int) -> ::c_int;
pub fn umtx_sleep(ptr: *const ::c_int, value: ::c_int, timeout: ::c_int) -> ::c_int;
pub fn umtx_wakeup(ptr: *const ::c_int, count: ::c_int) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn getmntinfo(mntbufp: *mut *mut ::statfs, flags: ::c_int) -> ::c_int;
pub fn getmntvinfo(
mntbufp: *mut *mut ::statfs,
mntvbufp: *mut *mut ::statvfs,
flags: ::c_int,
) -> ::c_int;
}
#[link(name = "rt")]
extern "C" {
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
pub fn reallocf(ptr: *mut ::c_void, size: ::size_t) -> *mut ::c_void;
pub fn freezero(ptr: *mut ::c_void, size: ::size_t);
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_vm_map_entry_first(
kvm: *mut ::kvm_t,
map: vm_map_t,
entry: vm_map_entry_t,
) -> vm_map_entry_t;
pub fn kvm_vm_map_entry_next(
kvm: *mut ::kvm_t,
map: vm_map_entry_t,
entry: vm_map_entry_t,
) -> vm_map_entry_t;
}
cfg_if! {
if #[cfg(libc_thread_local)] {
mod errno;
pub use self::errno::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/aarch64.rs 0000644 0000000 0000000 00000011555 10461020230 0020724 0 ustar 0000000 0000000 pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s_no_extra_traits! {
pub struct gpregs {
pub gp_x: [::register_t; 30],
pub gp_lr: ::register_t,
pub gp_sp: ::register_t,
pub gp_elr: ::register_t,
pub gp_spsr: u32,
pub gp_pad: ::c_int,
}
pub struct fpregs {
pub fp_q: u128,
pub fp_sr: u32,
pub fp_cr: u32,
pub fp_flags: ::c_int,
pub fp_pad: ::c_int,
}
pub struct mcontext_t {
pub mc_gpregs: gpregs,
pub mc_fpregs: fpregs,
pub mc_flags: ::c_int,
pub mc_pad: ::c_int,
pub mc_spare: [u64; 8],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
fn eq(&self, other: &gpregs) -> bool {
self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) &&
self.gp_lr == other.gp_lr &&
self.gp_sp == other.gp_sp &&
self.gp_elr == other.gp_elr &&
self.gp_spsr == other.gp_spsr &&
self.gp_pad == other.gp_pad
}
}
impl Eq for gpregs {}
impl ::fmt::Debug for gpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("gpregs")
.field("gp_x", &self.gp_x)
.field("gp_lr", &self.gp_lr)
.field("gp_sp", &self.gp_sp)
.field("gp_elr", &self.gp_elr)
.field("gp_spsr", &self.gp_spsr)
.field("gp_pad", &self.gp_pad)
.finish()
}
}
impl ::hash::Hash for gpregs {
fn hash(&self, state: &mut H) {
self.gp_x.hash(state);
self.gp_lr.hash(state);
self.gp_sp.hash(state);
self.gp_elr.hash(state);
self.gp_spsr.hash(state);
self.gp_pad.hash(state);
}
}
impl PartialEq for fpregs {
fn eq(&self, other: &fpregs) -> bool {
self.fp_q == other.fp_q &&
self.fp_sr == other.fp_sr &&
self.fp_cr == other.fp_cr &&
self.fp_flags == other.fp_flags &&
self.fp_pad == other.fp_pad
}
}
impl Eq for fpregs {}
impl ::fmt::Debug for fpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpregs")
.field("fp_q", &self.fp_q)
.field("fp_sr", &self.fp_sr)
.field("fp_cr", &self.fp_cr)
.field("fp_flags", &self.fp_flags)
.field("fp_pad", &self.fp_pad)
.finish()
}
}
impl ::hash::Hash for fpregs {
fn hash(&self, state: &mut H) {
self.fp_q.hash(state);
self.fp_sr.hash(state);
self.fp_cr.hash(state);
self.fp_flags.hash(state);
self.fp_pad.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_gpregs == other.mc_gpregs &&
self.mc_fpregs == other.mc_fpregs &&
self.mc_flags == other.mc_flags &&
self.mc_pad == other.mc_pad &&
self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_gpregs", &self.mc_gpregs)
.field("mc_fpregs", &self.mc_fpregs)
.field("mc_flags", &self.mc_flags)
.field("mc_pad", &self.mc_pad)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash(&self, state: &mut H) {
self.mc_gpregs.hash(state);
self.mc_fpregs.hash(state);
self.mc_flags.hash(state);
self.mc_pad.hash(state);
self.mc_spare.hash(state);
}
}
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/arm.rs 0000644 0000000 0000000 00000002614 10461020230 0020247 0 ustar 0000000 0000000 pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = u32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_atime_pad: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_mtime_pad: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_ctime_pad: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_birthtime_pad: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs 0000644 0000000 0000000 00000001453 10461020230 0021637 0 ustar 0000000 0000000 #[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs 0000644 0000000 0000000 00000042154 10461020230 0022026 0 ustar 0000000 0000000 // APIs that were changed after FreeBSD 11
// The type of `nlink_t` changed from `u16` to `u64` in FreeBSD 12:
pub type nlink_t = u16;
// Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12:
pub type dev_t = u32;
// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12:
pub type ino_t = u32;
s! {
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: ::intptr_t,
pub udata: *mut ::c_void,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
// Type of shm_nattc changed from `int` to `shmatt_t` (aka `unsigned
// int`) in FreeBSD 12:
pub shm_nattch: ::c_int,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *mut ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev: ::dev_t,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_reclen: u16,
pub d_type: u8,
// Type of `d_namlen` changed from `char` to `u16` in FreeBSD 12:
pub d_namlen: u8,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
// Array length changed from 88 to 1024 in FreeBSD 12:
pub f_mntfromname: [::c_char; 88],
// Array length changed from 88 to 1024 in FreeBSD 12:
pub f_mntonname: [::c_char; 88],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_dev: u32,
pub vn_fsid: u32,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_mntdir.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const ELAST: ::c_int = 96;
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const KI_NSPARE_PTR: usize = 6;
pub const MINCORE_SUPER: ::c_int = 0x20;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 63;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
(major << 8) | minor
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
((dev >> 8) & 0xff) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(dev & 0xffff00ff) as ::c_int
}
}
extern "C" {
// Return type ::c_int was removed in FreeBSD 12
pub fn setgrent() -> ::c_int;
// Type of `addr` argument changed from `const void*` to `void*`
// in FreeBSD 12
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
// Return type ::c_int was removed in FreeBSD 12
pub fn freelocale(loc: ::locale_t) -> ::c_int;
// Return type ::c_int changed to ::ssize_t in FreeBSD 12:
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::c_int;
// Type of `path` argument changed from `const void*` to `void*`
// in FreeBSD 12
pub fn dirname(path: *const ::c_char) -> *mut ::c_char;
pub fn basename(path: *const ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs 0000644 0000000 0000000 00000001534 10461020230 0021640 0 ustar 0000000 0000000 #[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs 0000644 0000000 0000000 00000042370 10461020230 0022027 0 ustar 0000000 0000000 // APIs in FreeBSD 12 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub version: ::c_uint,
pub paddr: ::c_ulong,
pub kmap_vaddr: ::c_ulong,
pub dmap_vaddr: ::c_ulong,
pub prot: ::vm_prot_t,
pub offset: ::u_long,
pub len: ::size_t,
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *mut ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: ::dev_t,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const ELAST: ::c_int = 97;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 63;
pub const KI_NSPARE_PTR: usize = 6;
pub const MINCORE_SUPER: ::c_int = 0x20;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs 0000644 0000000 0000000 00000000437 10461020230 0022204 0 ustar 0000000 0000000 pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs 0000644 0000000 0000000 00000001534 10461020230 0021641 0 ustar 0000000 0000000 #[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs 0000644 0000000 0000000 00000044607 10461020230 0022035 0 ustar 0000000 0000000 // APIs in FreeBSD 13 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x20;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs 0000644 0000000 0000000 00000000437 10461020230 0022205 0 ustar 0000000 0000000 pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs 0000644 0000000 0000000 00000001534 10461020230 0021642 0 ustar 0000000 0000000 #[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs 0000644 0000000 0000000 00000044607 10461020230 0022036 0 ustar 0000000 0000000 // APIs in FreeBSD 14 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x60;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs 0000644 0000000 0000000 00000001232 10461020230 0022200 0 ustar 0000000 0000000 pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs 0000644 0000000 0000000 00000001534 10461020230 0021643 0 ustar 0000000 0000000 #[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}
impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs 0000644 0000000 0000000 00000044607 10461020230 0022037 0 ustar 0000000 0000000 // APIs in FreeBSD 15 that have changed since 11.
pub type nlink_t = u64;
pub type dev_t = u64;
pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
pub ext: [u64; 4],
}
pub struct kvm_page {
pub kp_version: ::u_int,
pub kp_paddr: ::kpaddr_t,
pub kp_kmap_vaddr: ::kvaddr_t,
pub kp_dmap_vaddr: ::kvaddr_t,
pub kp_prot: ::vm_prot_t,
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
pub struct kinfo_proc {
/// Size of this structure.
pub ki_structsize: ::c_int,
/// Reserved: layout identifier.
pub ki_layout: ::c_int,
/// Address of command arguments.
pub ki_args: *mut ::pargs,
// This is normally "struct proc".
/// Address of proc.
pub ki_paddr: *mut ::c_void,
// This is normally "struct user".
/// Kernel virtual address of u-area.
pub ki_addr: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to trace file.
pub ki_tracep: *mut ::c_void,
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut ::c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut ::c_void,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut ::c_void,
/// Sleep address.
pub ki_wchan: *const ::c_void,
/// Process identifier.
pub ki_pid: ::pid_t,
/// Parent process ID.
pub ki_ppid: ::pid_t,
/// Process group ID.
pub ki_pgid: ::pid_t,
/// tty process group ID.
pub ki_tpgid: ::pid_t,
/// Process session ID.
pub ki_sid: ::pid_t,
/// Terminal session ID.
pub ki_tsid: ::pid_t,
/// Job control counter.
pub ki_jobc: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short1: ::c_short,
/// Controlling tty dev.
pub ki_tdev_freebsd11: u32,
/// Signals arrived but not delivered.
pub ki_siglist: ::sigset_t,
/// Current signal mask.
pub ki_sigmask: ::sigset_t,
/// Signals being ignored.
pub ki_sigignore: ::sigset_t,
/// Signals being caught by user.
pub ki_sigcatch: ::sigset_t,
/// Effective user ID.
pub ki_uid: ::uid_t,
/// Real user ID.
pub ki_ruid: ::uid_t,
/// Saved effective user ID.
pub ki_svuid: ::uid_t,
/// Real group ID.
pub ki_rgid: ::gid_t,
/// Saved effective group ID.
pub ki_svgid: ::gid_t,
/// Number of groups.
pub ki_ngroups: ::c_short,
/// Unused (just here for alignment).
pub ki_spare_short2: ::c_short,
/// Groups.
pub ki_groups: [::gid_t; ::KI_NGROUPS],
/// Virtual size.
pub ki_size: ::vm_size_t,
/// Current resident set size in pages.
pub ki_rssize: ::segsz_t,
/// Resident set size before last swap.
pub ki_swrss: ::segsz_t,
/// Text size (pages) XXX.
pub ki_tsize: ::segsz_t,
/// Data size (pages) XXX.
pub ki_dsize: ::segsz_t,
/// Stack size (pages).
pub ki_ssize: ::segsz_t,
/// Exit status for wait & stop signal.
pub ki_xstat: ::u_short,
/// Accounting flags.
pub ki_acflag: ::u_short,
/// %cpu for process during `ki_swtime`.
pub ki_pctcpu: ::fixpt_t,
/// Time averaged value of `ki_cpticks`.
pub ki_estcpu: ::u_int,
/// Time since last blocked.
pub ki_slptime: ::u_int,
/// Time swapped in or out.
pub ki_swtime: ::u_int,
/// Number of copy-on-write faults.
pub ki_cow: ::u_int,
/// Real time in microsec.
pub ki_runtime: u64,
/// Starting time.
pub ki_start: ::timeval,
/// Time used by process children.
pub ki_childtime: ::timeval,
/// P_* flags.
pub ki_flag: ::c_long,
/// KI_* flags (below).
pub ki_kiflag: ::c_long,
/// Kernel trace points.
pub ki_traceflag: ::c_int,
/// S* process status.
pub ki_stat: ::c_char,
/// Process "nice" value.
pub ki_nice: i8, // signed char
/// Process lock (prevent swap) count.
pub ki_lock: ::c_char,
/// Run queue index.
pub ki_rqindex: ::c_char,
/// Which cpu we are on.
pub ki_oncpu_old: ::c_uchar,
/// Last cpu we were on.
pub ki_lastcpu_old: ::c_uchar,
/// Thread name.
pub ki_tdname: [::c_char; ::TDNAMLEN + 1],
/// Wchan message.
pub ki_wmesg: [::c_char; ::WMESGLEN + 1],
/// Setlogin name.
pub ki_login: [::c_char; ::LOGNAMELEN + 1],
/// Lock name.
pub ki_lockname: [::c_char; ::LOCKNAMELEN + 1],
/// Command name.
pub ki_comm: [::c_char; ::COMMLEN + 1],
/// Emulation name.
pub ki_emul: [::c_char; ::KI_EMULNAMELEN + 1],
/// Login class.
pub ki_loginclass: [::c_char; ::LOGINCLASSLEN + 1],
/// More thread name.
pub ki_moretdname: [::c_char; ::MAXCOMLEN - ::TDNAMLEN + 1],
/// Spare string space.
pub ki_sparestrings: [[::c_char; 23]; 2], // little hack to allow PartialEq
/// Spare room for growth.
pub ki_spareints: [::c_int; ::KI_NSPARE_INT],
/// Controlling tty dev.
pub ki_tdev: u64,
/// Which cpu we are on.
pub ki_oncpu: ::c_int,
/// Last cpu we were on.
pub ki_lastcpu: ::c_int,
/// PID of tracing process.
pub ki_tracer: ::c_int,
/// P2_* flags.
pub ki_flag2: ::c_int,
/// Default FIB number.
pub ki_fibnum: ::c_int,
/// Credential flags.
pub ki_cr_flags: ::u_int,
/// Process jail ID.
pub ki_jid: ::c_int,
/// Number of threads in total.
pub ki_numthreads: ::c_int,
/// Thread ID.
pub ki_tid: ::lwpid_t,
/// Process priority.
pub ki_pri: ::priority,
/// Process rusage statistics.
pub ki_rusage: ::rusage,
/// rusage of children processes.
pub ki_rusage_ch: ::rusage,
// This is normally "struct pcb".
/// Kernel virtual addr of pcb.
pub ki_pcb: *mut ::c_void,
/// Kernel virtual addr of stack.
pub ki_kstack: *mut ::c_void,
/// User convenience pointer.
pub ki_udata: *mut ::c_void,
// This is normally "struct thread".
pub ki_tdaddr: *mut ::c_void,
// This is normally "struct pwddesc".
/// Pointer to process paths info.
pub ki_pd: *mut ::c_void,
pub ki_spareptrs: [*mut ::c_void; ::KI_NSPARE_PTR],
pub ki_sparelongs: [::c_long; ::KI_NSPARE_LONG],
/// PS_* flags.
pub ki_sflag: ::c_long,
/// kthread flag.
pub ki_tdflags: ::c_long,
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
d_pad0: u8,
pub d_namlen: u16,
d_pad1: u16,
pub d_name: [::c_char; 256],
}
pub struct statfs {
pub f_version: u32,
pub f_type: u32,
pub f_flags: u64,
pub f_bsize: u64,
pub f_iosize: u64,
pub f_blocks: u64,
pub f_bfree: u64,
pub f_bavail: i64,
pub f_files: u64,
pub f_ffree: i64,
pub f_syncwrites: u64,
pub f_asyncwrites: u64,
pub f_syncreads: u64,
pub f_asyncreads: u64,
f_spare: [u64; 10],
pub f_namemax: u32,
pub f_owner: ::uid_t,
pub f_fsid: ::fsid_t,
f_charspare: [::c_char; 80],
pub f_fstypename: [::c_char; 16],
pub f_mntfromname: [::c_char; 1024],
pub f_mntonname: [::c_char; 1024],
}
pub struct vnstat {
pub vn_fileid: u64,
pub vn_size: u64,
pub vn_dev: u64,
pub vn_fsid: u64,
pub vn_mntdir: *mut ::c_char,
pub vn_type: ::c_int,
pub vn_mode: u16,
pub vn_devname: [::c_char; ::SPECNAMELEN as usize + 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for statfs {
fn eq(&self, other: &statfs) -> bool {
self.f_version == other.f_version
&& self.f_type == other.f_type
&& self.f_flags == other.f_flags
&& self.f_bsize == other.f_bsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_syncreads == other.f_syncreads
&& self.f_asyncreads == other.f_asyncreads
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_fsid == other.f_fsid
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statfs {}
impl ::fmt::Debug for statfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statfs")
.field("f_bsize", &self.f_bsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_syncreads", &self.f_syncreads)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_fsid", &self.f_fsid)
.field("f_fstypename", &self.f_fstypename)
.field("f_mntfromname", &&self.f_mntfromname[..])
.field("f_mntonname", &&self.f_mntonname[..])
.finish()
}
}
impl ::hash::Hash for statfs {
fn hash(&self, state: &mut H) {
self.f_version.hash(state);
self.f_type.hash(state);
self.f_flags.hash(state);
self.f_bsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncwrites.hash(state);
self.f_syncreads.hash(state);
self.f_asyncreads.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_fsid.hash(state);
self.f_charspare.hash(state);
self.f_fstypename.hash(state);
self.f_mntfromname.hash(state);
self.f_mntonname.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name[..self.d_namlen as _]
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
.field("d_name", &&self.d_name[..self.d_namlen as _])
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name[..self.d_namlen as _].hash(state);
}
}
impl PartialEq for vnstat {
fn eq(&self, other: &vnstat) -> bool {
let self_vn_devname: &[::c_char] = &self.vn_devname;
let other_vn_devname: &[::c_char] = &other.vn_devname;
self.vn_fileid == other.vn_fileid &&
self.vn_size == other.vn_size &&
self.vn_dev == other.vn_dev &&
self.vn_fsid == other.vn_fsid &&
self.vn_mntdir == other.vn_mntdir &&
self.vn_type == other.vn_type &&
self.vn_mode == other.vn_mode &&
self_vn_devname == other_vn_devname
}
}
impl Eq for vnstat {}
impl ::fmt::Debug for vnstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_vn_devname: &[::c_char] = &self.vn_devname;
f.debug_struct("vnstat")
.field("vn_fileid", &self.vn_fileid)
.field("vn_size", &self.vn_size)
.field("vn_dev", &self.vn_dev)
.field("vn_fsid", &self.vn_fsid)
.field("vn_mntdir", &self.vn_mntdir)
.field("vn_type", &self.vn_type)
.field("vn_mode", &self.vn_mode)
.field("vn_devname", &self_vn_devname)
.finish()
}
}
impl ::hash::Hash for vnstat {
fn hash(&self, state: &mut H) {
let self_vn_devname: &[::c_char] = &self.vn_devname;
self.vn_fileid.hash(state);
self.vn_size.hash(state);
self.vn_dev.hash(state);
self.vn_fsid.hash(state);
self.vn_mntdir.hash(state);
self.vn_type.hash(state);
self.vn_mode.hash(state);
self_vn_devname.hash(state);
}
}
}
}
pub const RAND_MAX: ::c_int = 0x7fff_ffff;
pub const ELAST: ::c_int = 97;
pub const KF_TYPE_EVENTFD: ::c_int = 13;
/// max length of devicename
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
pub const MINCORE_SUPER: ::c_int = 0x60;
safe_f! {
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= ((major & 0xffffff00) as dev_t) << 32;
dev |= ((major & 0x000000ff) as dev_t) << 8;
dev |= ((minor & 0x0000ff00) as dev_t) << 24;
dev |= ((minor & 0xffff00ff) as dev_t) << 0;
dev
}
}
f! {
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
(((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as ::c_int
}
}
extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn freelocale(loc: ::locale_t);
pub fn msgrcv(
msqid: ::c_int,
msgp: *mut ::c_void,
msgsz: ::size_t,
msgtyp: ::c_long,
msgflg: ::c_int,
) -> ::ssize_t;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t;
}
cfg_if! {
if #[cfg(any(target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "riscv64"))] {
mod b64;
pub use self::b64::*;
}
}
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs 0000644 0000000 0000000 00000001232 10461020230 0022201 0 ustar 0000000 0000000 pub const PROC_KPTI_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN;
pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: ::c_int = 1;
pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: ::c_int = 2;
pub const PROC_KPTI_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 1;
pub const PROC_KPTI_STATUS_ACTIVE: ::c_int = 0x80000000;
pub const PROC_LA_CTL: ::c_int = ::PROC_PROCCTL_MD_MIN + 2;
pub const PROC_LA_STATUS: ::c_int = ::PROC_PROCCTL_MD_MIN + 3;
pub const PROC_LA_CTL_LA48_ON_EXEC: ::c_int = 1;
pub const PROC_LA_CTL_LA57_ON_EXEC: ::c_int = 2;
pub const PROC_LA_CTL_DEFAULT_ON_EXEC: ::c_int = 3;
pub const PROC_LA_STATUS_LA48: ::c_int = 0x01000000;
pub const PROC_LA_STATUS_LA57: ::c_int = 0x02000000;
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/mod.rs 0000644 0000000 0000000 00000603363 10461020230 0020257 0 ustar 0000000 0000000 pub type fflags_t = u32;
pub type clock_t = i32;
pub type vm_prot_t = u_char;
pub type kvaddr_t = u64;
pub type segsz_t = isize;
pub type __fixpt_t = u32;
pub type fixpt_t = __fixpt_t;
pub type __lwpid_t = i32;
pub type lwpid_t = __lwpid_t;
pub type blksize_t = i32;
pub type clockid_t = ::c_int;
pub type sem_t = _sem;
pub type timer_t = *mut __c_anonymous__timer;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
pub type msglen_t = ::c_ulong;
pub type msgqnum_t = ::c_ulong;
pub type cpulevel_t = ::c_int;
pub type cpuwhich_t = ::c_int;
pub type mqd_t = *mut ::c_void;
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock;
pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr;
pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier;
pub type uuid_t = ::uuid;
pub type u_int = ::c_uint;
pub type u_char = ::c_uchar;
pub type u_long = ::c_ulong;
pub type u_short = ::c_ushort;
pub type caddr_t = *mut ::c_char;
pub type fhandle_t = fhandle;
pub type au_id_t = ::uid_t;
pub type au_asid_t = ::pid_t;
pub type cpusetid_t = ::c_int;
pub type sctp_assoc_t = u32;
pub type eventfd_t = u64;
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_support_flags {
DEVSTAT_ALL_SUPPORTED = 0x00,
DEVSTAT_NO_BLOCKSIZE = 0x01,
DEVSTAT_NO_ORDERED_TAGS = 0x02,
DEVSTAT_BS_UNAVAILABLE = 0x04,
}
impl ::Copy for devstat_support_flags {}
impl ::Clone for devstat_support_flags {
fn clone(&self) -> devstat_support_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_trans_flags {
DEVSTAT_NO_DATA = 0x00,
DEVSTAT_READ = 0x01,
DEVSTAT_WRITE = 0x02,
DEVSTAT_FREE = 0x03,
}
impl ::Copy for devstat_trans_flags {}
impl ::Clone for devstat_trans_flags {
fn clone(&self) -> devstat_trans_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_tag_type {
DEVSTAT_TAG_SIMPLE = 0x00,
DEVSTAT_TAG_HEAD = 0x01,
DEVSTAT_TAG_ORDERED = 0x02,
DEVSTAT_TAG_NONE = 0x03,
}
impl ::Copy for devstat_tag_type {}
impl ::Clone for devstat_tag_type {
fn clone(&self) -> devstat_tag_type {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_match_flags {
DEVSTAT_MATCH_NONE = 0x00,
DEVSTAT_MATCH_TYPE = 0x01,
DEVSTAT_MATCH_IF = 0x02,
DEVSTAT_MATCH_PASS = 0x04,
}
impl ::Copy for devstat_match_flags {}
impl ::Clone for devstat_match_flags {
fn clone(&self) -> devstat_match_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_priority {
DEVSTAT_PRIORITY_MIN = 0x000,
DEVSTAT_PRIORITY_OTHER = 0x020,
DEVSTAT_PRIORITY_PASS = 0x030,
DEVSTAT_PRIORITY_FD = 0x040,
DEVSTAT_PRIORITY_WFD = 0x050,
DEVSTAT_PRIORITY_TAPE = 0x060,
DEVSTAT_PRIORITY_CD = 0x090,
DEVSTAT_PRIORITY_DISK = 0x110,
DEVSTAT_PRIORITY_ARRAY = 0x120,
DEVSTAT_PRIORITY_MAX = 0xfff,
}
impl ::Copy for devstat_priority {}
impl ::Clone for devstat_priority {
fn clone(&self) -> devstat_priority {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_type_flags {
DEVSTAT_TYPE_DIRECT = 0x000,
DEVSTAT_TYPE_SEQUENTIAL = 0x001,
DEVSTAT_TYPE_PRINTER = 0x002,
DEVSTAT_TYPE_PROCESSOR = 0x003,
DEVSTAT_TYPE_WORM = 0x004,
DEVSTAT_TYPE_CDROM = 0x005,
DEVSTAT_TYPE_SCANNER = 0x006,
DEVSTAT_TYPE_OPTICAL = 0x007,
DEVSTAT_TYPE_CHANGER = 0x008,
DEVSTAT_TYPE_COMM = 0x009,
DEVSTAT_TYPE_ASC0 = 0x00a,
DEVSTAT_TYPE_ASC1 = 0x00b,
DEVSTAT_TYPE_STORARRAY = 0x00c,
DEVSTAT_TYPE_ENCLOSURE = 0x00d,
DEVSTAT_TYPE_FLOPPY = 0x00e,
DEVSTAT_TYPE_MASK = 0x00f,
DEVSTAT_TYPE_IF_SCSI = 0x010,
DEVSTAT_TYPE_IF_IDE = 0x020,
DEVSTAT_TYPE_IF_OTHER = 0x030,
DEVSTAT_TYPE_IF_MASK = 0x0f0,
DEVSTAT_TYPE_PASS = 0x100,
}
impl ::Copy for devstat_type_flags {}
impl ::Clone for devstat_type_flags {
fn clone(&self) -> devstat_type_flags {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_metric {
DSM_NONE,
DSM_TOTAL_BYTES,
DSM_TOTAL_BYTES_READ,
DSM_TOTAL_BYTES_WRITE,
DSM_TOTAL_TRANSFERS,
DSM_TOTAL_TRANSFERS_READ,
DSM_TOTAL_TRANSFERS_WRITE,
DSM_TOTAL_TRANSFERS_OTHER,
DSM_TOTAL_BLOCKS,
DSM_TOTAL_BLOCKS_READ,
DSM_TOTAL_BLOCKS_WRITE,
DSM_KB_PER_TRANSFER,
DSM_KB_PER_TRANSFER_READ,
DSM_KB_PER_TRANSFER_WRITE,
DSM_TRANSFERS_PER_SECOND,
DSM_TRANSFERS_PER_SECOND_READ,
DSM_TRANSFERS_PER_SECOND_WRITE,
DSM_TRANSFERS_PER_SECOND_OTHER,
DSM_MB_PER_SECOND,
DSM_MB_PER_SECOND_READ,
DSM_MB_PER_SECOND_WRITE,
DSM_BLOCKS_PER_SECOND,
DSM_BLOCKS_PER_SECOND_READ,
DSM_BLOCKS_PER_SECOND_WRITE,
DSM_MS_PER_TRANSACTION,
DSM_MS_PER_TRANSACTION_READ,
DSM_MS_PER_TRANSACTION_WRITE,
DSM_SKIP,
DSM_TOTAL_BYTES_FREE,
DSM_TOTAL_TRANSFERS_FREE,
DSM_TOTAL_BLOCKS_FREE,
DSM_KB_PER_TRANSFER_FREE,
DSM_MB_PER_SECOND_FREE,
DSM_TRANSFERS_PER_SECOND_FREE,
DSM_BLOCKS_PER_SECOND_FREE,
DSM_MS_PER_TRANSACTION_OTHER,
DSM_MS_PER_TRANSACTION_FREE,
DSM_BUSY_PCT,
DSM_QUEUE_LENGTH,
DSM_TOTAL_DURATION,
DSM_TOTAL_DURATION_READ,
DSM_TOTAL_DURATION_WRITE,
DSM_TOTAL_DURATION_FREE,
DSM_TOTAL_DURATION_OTHER,
DSM_TOTAL_BUSY_TIME,
DSM_MAX,
}
impl ::Copy for devstat_metric {}
impl ::Clone for devstat_metric {
fn clone(&self) -> devstat_metric {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))]
#[repr(u32)]
pub enum devstat_select_mode {
DS_SELECT_ADD,
DS_SELECT_ONLY,
DS_SELECT_REMOVE,
DS_SELECT_ADDONLY,
}
impl ::Copy for devstat_select_mode {}
impl ::Clone for devstat_select_mode {
fn clone(&self) -> devstat_select_mode {
*self
}
}
s! {
pub struct aiocb {
pub aio_fildes: ::c_int,
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
__unused1: [::c_int; 2],
__unused2: *mut ::c_void,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
// unused 3 through 5 are the __aiocb_private structure
__unused3: ::c_long,
__unused4: ::c_long,
__unused5: *mut ::c_void,
pub aio_sigevent: sigevent
}
pub struct jail {
pub version: u32,
pub path: *mut ::c_char,
pub hostname: *mut ::c_char,
pub jailname: *mut ::c_char,
pub ip4s: ::c_uint,
pub ip6s: ::c_uint,
pub ip4: *mut ::in_addr,
pub ip6: *mut ::in6_addr,
}
pub struct statvfs {
pub f_bavail: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_blocks: ::fsblkcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_bsize: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_fsid: ::c_ulong,
pub f_namemax: ::c_ulong,
}
// internal structure has changed over time
pub struct _sem {
data: [u32; 4],
}
pub struct sembuf {
pub sem_num: ::c_ushort,
pub sem_op: ::c_short,
pub sem_flg: ::c_short,
}
pub struct msqid_ds {
pub msg_perm: ::ipc_perm,
__unused1: *mut ::c_void,
__unused2: *mut ::c_void,
pub msg_cbytes: ::msglen_t,
pub msg_qnum: ::msgqnum_t,
pub msg_qbytes: ::msglen_t,
pub msg_lspid: ::pid_t,
pub msg_lrpid: ::pid_t,
pub msg_stime: ::time_t,
pub msg_rtime: ::time_t,
pub msg_ctime: ::time_t,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::ssize_t,
}
pub struct sockcred {
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
pub struct ptrace_vm_entry {
pub pve_entry: ::c_int,
pub pve_timestamp: ::c_int,
pub pve_start: ::c_ulong,
pub pve_end: ::c_ulong,
pub pve_offset: ::c_ulong,
pub pve_prot: ::c_uint,
pub pve_pathlen: ::c_uint,
pub pve_fileid: ::c_long,
pub pve_fsid: u32,
pub pve_path: *mut ::c_char,
}
pub struct ptrace_lwpinfo {
pub pl_lwpid: lwpid_t,
pub pl_event: ::c_int,
pub pl_flags: ::c_int,
pub pl_sigmask: ::sigset_t,
pub pl_siglist: ::sigset_t,
pub pl_siginfo: ::siginfo_t,
pub pl_tdname: [::c_char; ::MAXCOMLEN as usize + 1],
pub pl_child_pid: ::pid_t,
pub pl_syscall_code: ::c_uint,
pub pl_syscall_narg: ::c_uint,
}
pub struct ptrace_sc_ret {
pub sr_retval: [::register_t; 2],
pub sr_error: ::c_int,
}
pub struct ptrace_coredump {
pub pc_fd: ::c_int,
pub pc_flags: u32,
pub pc_limit: ::off_t,
}
pub struct ptrace_sc_remote {
pub pscr_ret: ptrace_sc_ret,
pub pscr_syscall: ::c_uint,
pub pscr_nargs: ::c_uint,
pub pscr_args: *mut ::register_t,
}
pub struct cpuset_t {
#[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "64"))]
__bits: [::c_long; 16],
#[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "32"))]
__bits: [::c_long; 32],
#[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "64"))]
__bits: [::c_long; 4],
#[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "32"))]
__bits: [::c_long; 8],
}
pub struct cap_rights_t {
cr_rights: [u64; 2],
}
pub struct umutex {
m_owner: ::lwpid_t,
m_flags: u32,
m_ceilings: [u32; 2],
m_rb_link: ::uintptr_t,
#[cfg(target_pointer_width = "32")]
m_pad: u32,
m_spare: [u32; 2],
}
pub struct ucond {
c_has_waiters: u32,
c_flags: u32,
c_clockid: u32,
c_spare: [u32; 1],
}
pub struct uuid {
pub time_low: u32,
pub time_mid: u16,
pub time_hi_and_version: u16,
pub clock_seq_hi_and_reserved: u8,
pub clock_seq_low: u8,
pub node: [u8; _UUID_NODE_LEN],
}
pub struct __c_anonymous_pthread_spinlock {
s_clock: umutex,
}
pub struct __c_anonymous_pthread_barrierattr {
pshared: ::c_int,
}
pub struct __c_anonymous_pthread_barrier {
b_lock: umutex,
b_cv: ucond,
b_cycle: i64,
b_count: ::c_int,
b_waiters: ::c_int,
b_refcount: ::c_int,
b_destroying: ::c_int,
}
pub struct kinfo_vmentry {
pub kve_structsize: ::c_int,
pub kve_type: ::c_int,
pub kve_start: u64,
pub kve_end: u64,
pub kve_offset: u64,
pub kve_vn_fileid: u64,
#[cfg(not(freebsd11))]
pub kve_vn_fsid_freebsd11: u32,
#[cfg(freebsd11)]
pub kve_vn_fsid: u32,
pub kve_flags: ::c_int,
pub kve_resident: ::c_int,
pub kve_private_resident: ::c_int,
pub kve_protection: ::c_int,
pub kve_ref_count: ::c_int,
pub kve_shadow_count: ::c_int,
pub kve_vn_type: ::c_int,
pub kve_vn_size: u64,
#[cfg(not(freebsd11))]
pub kve_vn_rdev_freebsd11: u32,
#[cfg(freebsd11)]
pub kve_vn_rdev: u32,
pub kve_vn_mode: u16,
pub kve_status: u16,
#[cfg(not(freebsd11))]
pub kve_vn_fsid: u64,
#[cfg(not(freebsd11))]
pub kve_vn_rdev: u64,
#[cfg(not(freebsd11))]
_kve_is_spare: [::c_int; 8],
#[cfg(freebsd11)]
_kve_is_spare: [::c_int; 12],
pub kve_path: [[::c_char; 32]; 32],
}
pub struct __c_anonymous_filestat {
pub stqe_next: *mut filestat,
}
pub struct filestat {
pub fs_type: ::c_int,
pub fs_flags: ::c_int,
pub fs_fflags: ::c_int,
pub fs_uflags: ::c_int,
pub fs_fd: ::c_int,
pub fs_ref_count: ::c_int,
pub fs_offset: ::off_t,
pub fs_typedep: *mut ::c_void,
pub fs_path: *mut ::c_char,
pub next: __c_anonymous_filestat,
pub fs_cap_rights: cap_rights_t,
}
pub struct filestat_list {
pub stqh_first: *mut filestat,
pub stqh_last: *mut *mut filestat,
}
pub struct procstat {
pub tpe: ::c_int,
pub kd: ::uintptr_t,
pub vmentries: *mut ::c_void,
pub files: *mut ::c_void,
pub argv: *mut ::c_void,
pub envv: *mut ::c_void,
pub core: ::uintptr_t,
}
pub struct itimerspec {
pub it_interval: ::timespec,
pub it_value: ::timespec,
}
pub struct __c_anonymous__timer {
_priv: [::c_int; 3],
}
/// Used to hold a copy of the command line, if it had a sane length.
pub struct pargs {
/// Reference count.
pub ar_ref: u_int,
/// Length.
pub ar_length: u_int,
/// Arguments.
pub ar_args: [::c_uchar; 1],
}
pub struct priority {
/// Scheduling class.
pub pri_class: u_char,
/// Normal priority level.
pub pri_level: u_char,
/// Priority before propagation.
pub pri_native: u_char,
/// User priority based on p_cpu and p_nice.
pub pri_user: u_char,
}
pub struct kvm_swap {
pub ksw_devname: [::c_char; 32],
pub ksw_used: u_int,
pub ksw_total: u_int,
pub ksw_flags: ::c_int,
pub ksw_reserved1: u_int,
pub ksw_reserved2: u_int,
}
pub struct nlist {
/// symbol name (in memory)
pub n_name: *const ::c_char,
/// type defines
pub n_type: ::c_uchar,
/// "type" and binding information
pub n_other: ::c_char,
/// used by stab entries
pub n_desc: ::c_short,
pub n_value: ::c_ulong,
}
pub struct kvm_nlist {
pub n_name: *const ::c_char,
pub n_type: ::c_uchar,
pub n_value: ::kvaddr_t,
}
pub struct __c_anonymous_sem {
_priv: ::uintptr_t,
}
pub struct semid_ds {
pub sem_perm: ::ipc_perm,
pub __sem_base: *mut __c_anonymous_sem,
pub sem_nsems: ::c_ushort,
pub sem_otime: ::time_t,
pub sem_ctime: ::time_t,
}
pub struct vmtotal {
pub t_vm: u64,
pub t_avm: u64,
pub t_rm: u64,
pub t_arm: u64,
pub t_vmshr: u64,
pub t_avmshr: u64,
pub t_rmshr: u64,
pub t_armshr: u64,
pub t_free: u64,
pub t_rq: i16,
pub t_dw: i16,
pub t_pw: i16,
pub t_sl: i16,
pub t_sw: i16,
pub t_pad: [u16; 3],
}
pub struct sockstat {
pub inp_ppcb: u64,
pub so_addr: u64,
pub so_pcb: u64,
pub unp_conn: u64,
pub dom_family: ::c_int,
pub proto: ::c_int,
pub so_rcv_sb_state: ::c_int,
pub so_snd_sb_state: ::c_int,
/// Socket address.
pub sa_local: ::sockaddr_storage,
/// Peer address.
pub sa_peer: ::sockaddr_storage,
pub type_: ::c_int,
pub dname: [::c_char; 32],
#[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
pub sendq: ::c_uint,
#[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
pub recvq: ::c_uint,
}
pub struct shmstat {
pub size: u64,
pub mode: u16,
}
pub struct spacectl_range {
pub r_offset: ::off_t,
pub r_len: ::off_t
}
pub struct rusage_ext {
pub rux_runtime: u64,
pub rux_uticks: u64,
pub rux_sticks: u64,
pub rux_iticks: u64,
pub rux_uu: u64,
pub rux_su: u64,
pub rux_tu: u64,
}
pub struct if_clonereq {
pub ifcr_total: ::c_int,
pub ifcr_count: ::c_int,
pub ifcr_buffer: *mut ::c_char,
}
pub struct if_msghdr {
/// to skip over non-understood messages
pub ifm_msglen: ::c_ushort,
/// future binary compatibility
pub ifm_version: ::c_uchar,
/// message type
pub ifm_type: ::c_uchar,
/// like rtm_addrs
pub ifm_addrs: ::c_int,
/// value of if_flags
pub ifm_flags: ::c_int,
/// index for associated ifp
pub ifm_index: ::c_ushort,
pub _ifm_spare1: ::c_ushort,
/// statistics and other data about if
pub ifm_data: if_data,
}
pub struct if_msghdrl {
/// to skip over non-understood messages
pub ifm_msglen: ::c_ushort,
/// future binary compatibility
pub ifm_version: ::c_uchar,
/// message type
pub ifm_type: ::c_uchar,
/// like rtm_addrs
pub ifm_addrs: ::c_int,
/// value of if_flags
pub ifm_flags: ::c_int,
/// index for associated ifp
pub ifm_index: ::c_ushort,
/// spare space to grow if_index, see if_var.h
pub _ifm_spare1: ::c_ushort,
/// length of if_msghdrl incl. if_data
pub ifm_len: ::c_ushort,
/// offset of if_data from beginning
pub ifm_data_off: ::c_ushort,
pub _ifm_spare2: ::c_int,
/// statistics and other data about if
pub ifm_data: if_data,
}
pub struct ifa_msghdr {
/// to skip over non-understood messages
pub ifam_msglen: ::c_ushort,
/// future binary compatibility
pub ifam_version: ::c_uchar,
/// message type
pub ifam_type: ::c_uchar,
/// like rtm_addrs
pub ifam_addrs: ::c_int,
/// value of ifa_flags
pub ifam_flags: ::c_int,
/// index for associated ifp
pub ifam_index: ::c_ushort,
pub _ifam_spare1: ::c_ushort,
/// value of ifa_ifp->if_metric
pub ifam_metric: ::c_int,
}
pub struct ifa_msghdrl {
/// to skip over non-understood messages
pub ifam_msglen: ::c_ushort,
/// future binary compatibility
pub ifam_version: ::c_uchar,
/// message type
pub ifam_type: ::c_uchar,
/// like rtm_addrs
pub ifam_addrs: ::c_int,
/// value of ifa_flags
pub ifam_flags: ::c_int,
/// index for associated ifp
pub ifam_index: ::c_ushort,
/// spare space to grow if_index, see if_var.h
pub _ifam_spare1: ::c_ushort,
/// length of ifa_msghdrl incl. if_data
pub ifam_len: ::c_ushort,
/// offset of if_data from beginning
pub ifam_data_off: ::c_ushort,
/// value of ifa_ifp->if_metric
pub ifam_metric: ::c_int,
/// statistics and other data about if or address
pub ifam_data: if_data,
}
pub struct ifma_msghdr {
/// to skip over non-understood messages
pub ifmam_msglen: ::c_ushort,
/// future binary compatibility
pub ifmam_version: ::c_uchar,
/// message type
pub ifmam_type: ::c_uchar,
/// like rtm_addrs
pub ifmam_addrs: ::c_int,
/// value of ifa_flags
pub ifmam_flags: ::c_int,
/// index for associated ifp
pub ifmam_index: ::c_ushort,
pub _ifmam_spare1: ::c_ushort,
}
pub struct if_announcemsghdr {
/// to skip over non-understood messages
pub ifan_msglen: ::c_ushort,
/// future binary compatibility
pub ifan_version: ::c_uchar,
/// message type
pub ifan_type: ::c_uchar,
/// index for associated ifp
pub ifan_index: ::c_ushort,
/// if name, e.g. "en0"
pub ifan_name: [::c_char; ::IFNAMSIZ as usize],
/// what type of announcement
pub ifan_what: ::c_ushort,
}
pub struct ifreq_buffer {
pub length: ::size_t,
pub buffer: *mut ::c_void,
}
pub struct ifaliasreq {
/// if name, e.g. "en0"
pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
pub ifra_addr: ::sockaddr,
pub ifra_broadaddr: ::sockaddr,
pub ifra_mask: ::sockaddr,
pub ifra_vhid: ::c_int,
}
/// 9.x compat
pub struct oifaliasreq {
/// if name, e.g. "en0"
pub ifra_name: [::c_char; ::IFNAMSIZ as usize],
pub ifra_addr: ::sockaddr,
pub ifra_broadaddr: ::sockaddr,
pub ifra_mask: ::sockaddr,
}
pub struct ifmediareq {
/// if name, e.g. "en0"
pub ifm_name: [::c_char; ::IFNAMSIZ as usize],
/// current media options
pub ifm_current: ::c_int,
/// don't care mask
pub ifm_mask: ::c_int,
/// media status
pub ifm_status: ::c_int,
/// active options
pub ifm_active: ::c_int,
/// # entries in ifm_ulist array
pub ifm_count: ::c_int,
/// media words
pub ifm_ulist: *mut ::c_int,
}
pub struct ifdrv {
/// if name, e.g. "en0"
pub ifd_name: [::c_char; ::IFNAMSIZ as usize],
pub ifd_cmd: ::c_ulong,
pub ifd_len: ::size_t,
pub ifd_data: *mut ::c_void,
}
pub struct ifi2creq {
/// i2c address (0xA0, 0xA2)
pub dev_addr: u8,
/// read offset
pub offset: u8,
/// read length
pub len: u8,
pub spare0: u8,
pub spare1: u32,
/// read buffer
pub data: [u8; 8],
}
pub struct ifrsshash {
/// if name, e.g. "en0"
pub ifrh_name: [::c_char; ::IFNAMSIZ as usize],
/// RSS_FUNC_
pub ifrh_func: u8,
pub ifrh_spare0: u8,
pub ifrh_spare1: u16,
/// RSS_TYPE_
pub ifrh_types: u32,
}
pub struct ifmibdata {
/// name of interface
pub ifmd_name: [::c_char; ::IFNAMSIZ as usize],
/// number of promiscuous listeners
pub ifmd_pcount: ::c_int,
/// interface flags
pub ifmd_flags: ::c_int,
/// instantaneous length of send queue
pub ifmd_snd_len: ::c_int,
/// maximum length of send queue
pub ifmd_snd_maxlen: ::c_int,
/// number of drops in send queue
pub ifmd_snd_drops: ::c_int,
/// for future expansion
pub ifmd_filler: [::c_int; 4],
/// generic information and statistics
pub ifmd_data: if_data,
}
pub struct ifmib_iso_8802_3 {
pub dot3StatsAlignmentErrors: u32,
pub dot3StatsFCSErrors: u32,
pub dot3StatsSingleCollisionFrames: u32,
pub dot3StatsMultipleCollisionFrames: u32,
pub dot3StatsSQETestErrors: u32,
pub dot3StatsDeferredTransmissions: u32,
pub dot3StatsLateCollisions: u32,
pub dot3StatsExcessiveCollisions: u32,
pub dot3StatsInternalMacTransmitErrors: u32,
pub dot3StatsCarrierSenseErrors: u32,
pub dot3StatsFrameTooLongs: u32,
pub dot3StatsInternalMacReceiveErrors: u32,
pub dot3StatsEtherChipSet: u32,
pub dot3StatsMissedFrames: u32,
pub dot3StatsCollFrequencies: [u32; 16],
pub dot3Compliance: u32,
}
pub struct __c_anonymous_ph {
pub ph1: u64,
pub ph2: u64,
}
pub struct fid {
pub fid_len: ::c_ushort,
pub fid_data0: ::c_ushort,
pub fid_data: [::c_char; ::MAXFIDSZ as usize],
}
pub struct fhandle {
pub fh_fsid: ::fsid_t,
pub fh_fid: fid,
}
pub struct bintime {
pub sec: ::time_t,
pub frac: u64,
}
pub struct clockinfo {
/// clock frequency
pub hz: ::c_int,
/// micro-seconds per hz tick
pub tick: ::c_int,
pub spare: ::c_int,
/// statistics clock frequency
pub stathz: ::c_int,
/// profiling clock frequency
pub profhz: ::c_int,
}
pub struct __c_anonymous_stailq_entry_devstat {
pub stqe_next: *mut devstat,
}
pub struct devstat {
/// Update sequence
pub sequence0: ::u_int,
/// Allocated entry
pub allocated: ::c_int,
/// started ops
pub start_count: ::u_int,
/// completed ops
pub end_count: ::u_int,
/// busy time unaccounted for since this time
pub busy_from: bintime,
pub dev_links: __c_anonymous_stailq_entry_devstat,
/// Devstat device number.
pub device_number: u32,
pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
pub unit_number: ::c_int,
pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize],
pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize],
pub busy_time: bintime,
/// Time the device was created.
pub creation_time: bintime,
/// Block size, bytes
pub block_size: u32,
/// The number of simple, ordered, and head of queue tags sent.
pub tag_types: [u64; 3],
/// Which statistics are supported by a given device.
pub flags: devstat_support_flags,
/// Device type
pub device_type: devstat_type_flags,
/// Controls list pos.
pub priority: devstat_priority,
/// Identification for GEOM nodes
pub id: *const ::c_void,
/// Update sequence
pub sequence1: ::u_int,
}
pub struct devstat_match {
pub match_fields: devstat_match_flags,
pub device_type: devstat_type_flags,
pub num_match_categories: ::c_int,
}
pub struct devstat_match_table {
pub match_str: *const ::c_char,
pub type_: devstat_type_flags,
pub match_field: devstat_match_flags,
}
pub struct device_selection {
pub device_number: u32,
pub device_name: [::c_char; DEVSTAT_NAME_LEN as usize],
pub unit_number: ::c_int,
pub selected: ::c_int,
pub bytes: u64,
pub position: ::c_int,
}
pub struct devinfo {
pub devices: *mut devstat,
pub mem_ptr: *mut u8,
pub generation: ::c_long,
pub numdevs: ::c_int,
}
pub struct sockcred2 {
pub sc_version: ::c_int,
pub sc_pid: ::pid_t,
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
pub struct ifconf {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
#[cfg(not(libc_union))]
pub ifc_ifcu: *mut ifreq,
}
pub struct au_mask_t {
pub am_success: ::c_uint,
pub am_failure: ::c_uint,
}
pub struct au_tid_t {
pub port: u32,
pub machine: u32,
}
pub struct auditinfo_t {
pub ai_auid: ::au_id_t,
pub ai_mask: ::au_mask_t,
pub ai_termid: au_tid_t,
pub ai_asid: ::au_asid_t,
}
pub struct tcp_fastopen {
pub enable: ::c_int,
pub psk: [u8; ::TCP_FASTOPEN_PSK_LEN as usize],
}
pub struct tcp_function_set {
pub function_set_name: [::c_char; ::TCP_FUNCTION_NAME_LEN_MAX as usize],
pub pcbcnt: u32,
}
// Note: this structure will change in a backwards-incompatible way in
// FreeBSD 15.
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
pub __tcpi_retransmits: u8,
pub __tcpi_probes: u8,
pub __tcpi_backoff: u8,
pub tcpi_options: u8,
pub tcp_snd_wscale: u8,
pub tcp_rcv_wscale: u8,
pub tcpi_rto: u32,
pub __tcpi_ato: u32,
pub tcpi_snd_mss: u32,
pub tcpi_rcv_mss: u32,
pub __tcpi_unacked: u32,
pub __tcpi_sacked: u32,
pub __tcpi_lost: u32,
pub __tcpi_retrans: u32,
pub __tcpi_fackets: u32,
pub __tcpi_last_data_sent: u32,
pub __tcpi_last_ack_sent: u32,
pub tcpi_last_data_recv: u32,
pub __tcpi_last_ack_recv: u32,
pub __tcpi_pmtu: u32,
pub __tcpi_rcv_ssthresh: u32,
pub tcpi_rtt: u32,
pub tcpi_rttvar: u32,
pub tcpi_snd_ssthresh: u32,
pub tcpi_snd_cwnd: u32,
pub __tcpi_advmss: u32,
pub __tcpi_reordering: u32,
pub __tcpi_rcv_rtt: u32,
pub tcpi_rcv_space: u32,
pub tcpi_snd_wnd: u32,
pub tcpi_snd_bwnd: u32,
pub tcpi_snd_nxt: u32,
pub tcpi_rcv_nxt: u32,
pub tcpi_toe_tid: u32,
pub tcpi_snd_rexmitpack: u32,
pub tcpi_rcv_ooopack: u32,
pub tcpi_snd_zerowin: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_delivered_ce: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_received_ce: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_delivered_e1_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_delivered_e0_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_delivered_ce_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_received_e1_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_received_e0_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub __tcpi_received_ce_bytes: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_total_tlp: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_total_tlp_bytes: u64,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_snd_una: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_snd_max: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_rcv_numsacks: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_rcv_adv: u32,
#[cfg(any(freebsd15, freebsd14))]
pub tcpi_dupacks: u32,
#[cfg(freebsd14)]
pub __tcpi_pad: [u32; 10],
#[cfg(freebsd15)]
pub __tcpi_pad: [u32; 14],
#[cfg(not(any(freebsd15, freebsd14)))]
pub __tcpi_pad: [u32; 26],
}
pub struct _umtx_time {
pub _timeout: ::timespec,
pub _flags: u32,
pub _clockid: u32,
}
pub struct shm_largepage_conf {
pub psind: ::c_int,
pub alloc_policy: ::c_int,
__pad: [::c_int; 10],
}
pub struct memory_type {
__priva: [::uintptr_t; 32],
__privb: [::uintptr_t; 26],
}
pub struct memory_type_list {
__priv: [::uintptr_t; 2],
}
pub struct pidfh {
__priva: [[::uintptr_t; 32]; 8],
__privb: [::uintptr_t; 2],
}
pub struct sctp_event {
pub se_assoc_id: ::sctp_assoc_t,
pub se_type: u16,
pub se_on: u8,
}
pub struct sctp_event_subscribe {
pub sctp_data_io_event: u8,
pub sctp_association_event: u8,
pub sctp_address_event: u8,
pub sctp_send_failure_event: u8,
pub sctp_peer_error_event: u8,
pub sctp_shutdown_event: u8,
pub sctp_partial_delivery_event: u8,
pub sctp_adaptation_layer_event: u8,
pub sctp_authentication_event: u8,
pub sctp_sender_dry_event: u8,
pub sctp_stream_reset_event: u8,
}
pub struct sctp_initmsg {
pub sinit_num_ostreams: u16,
pub sinit_max_instreams: u16,
pub sinit_max_attempts: u16,
pub sinit_max_init_timeo: u16,
}
pub struct sctp_sndrcvinfo {
pub sinfo_stream: u16,
pub sinfo_ssn: u16,
pub sinfo_flags: u16,
pub sinfo_ppid: u32,
pub sinfo_context: u32,
pub sinfo_timetolive: u32,
pub sinfo_tsn: u32,
pub sinfo_cumtsn: u32,
pub sinfo_assoc_id: ::sctp_assoc_t,
pub sinfo_keynumber: u16,
pub sinfo_keynumber_valid: u16,
pub __reserve_pad: [[u8; 23]; 4],
}
pub struct sctp_extrcvinfo {
pub sinfo_stream: u16,
pub sinfo_ssn: u16,
pub sinfo_flags: u16,
pub sinfo_ppid: u32,
pub sinfo_context: u32,
pub sinfo_timetolive: u32,
pub sinfo_tsn: u32,
pub sinfo_cumtsn: u32,
pub sinfo_assoc_id: ::sctp_assoc_t,
pub serinfo_next_flags: u16,
pub serinfo_next_stream: u16,
pub serinfo_next_aid: u32,
pub serinfo_next_length: u32,
pub serinfo_next_ppid: u32,
pub sinfo_keynumber: u16,
pub sinfo_keynumber_valid: u16,
pub __reserve_pad: [[u8; 19]; 4],
}
pub struct sctp_sndinfo {
pub snd_sid: u16,
pub snd_flags: u16,
pub snd_ppid: u32,
pub snd_context: u32,
pub snd_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_prinfo {
pub pr_policy: u16,
pub pr_value: u32,
}
pub struct sctp_default_prinfo {
pub pr_policy: u16,
pub pr_value: u32,
pub pr_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_authinfo {
pub auth_keynumber: u16,
}
pub struct sctp_rcvinfo {
pub rcv_sid: u16,
pub rcv_ssn: u16,
pub rcv_flags: u16,
pub rcv_ppid: u32,
pub rcv_tsn: u32,
pub rcv_cumtsn: u32,
pub rcv_context: u32,
pub rcv_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_nxtinfo {
pub nxt_sid: u16,
pub nxt_flags: u16,
pub nxt_ppid: u32,
pub nxt_length: u32,
pub nxt_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_recvv_rn {
pub recvv_rcvinfo: sctp_rcvinfo,
pub recvv_nxtinfo: sctp_nxtinfo,
}
pub struct sctp_sendv_spa {
pub sendv_flags: u32,
pub sendv_sndinfo: sctp_sndinfo,
pub sendv_prinfo: sctp_prinfo,
pub sendv_authinfo: sctp_authinfo,
}
pub struct sctp_snd_all_completes {
pub sall_stream: u16,
pub sall_flags: u16,
pub sall_ppid: u32,
pub sall_context: u32,
pub sall_num_sent: u32,
pub sall_num_failed: u32,
}
pub struct sctp_pcbinfo {
pub ep_count: u32,
pub asoc_count: u32,
pub laddr_count: u32,
pub raddr_count: u32,
pub chk_count: u32,
pub readq_count: u32,
pub free_chunks: u32,
pub stream_oque: u32,
}
pub struct sctp_sockstat {
pub ss_assoc_id: ::sctp_assoc_t,
pub ss_total_sndbuf: u32,
pub ss_total_recv_buf: u32,
}
pub struct sctp_assoc_change {
pub sac_type: u16,
pub sac_flags: u16,
pub sac_length: u32,
pub sac_state: u16,
pub sac_error: u16,
pub sac_outbound_streams: u16,
pub sac_inbound_streams: u16,
pub sac_assoc_id: ::sctp_assoc_t,
pub sac_info: [u8; 0],
}
pub struct sctp_paddr_change {
pub spc_type: u16,
pub spc_flags: u16,
pub spc_length: u32,
pub spc_aaddr: ::sockaddr_storage,
pub spc_state: u32,
pub spc_error: u32,
pub spc_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_remote_error {
pub sre_type: u16,
pub sre_flags: u16,
pub sre_length: u32,
pub sre_error: u16,
pub sre_assoc_id: ::sctp_assoc_t,
pub sre_data: [u8; 0],
}
pub struct sctp_send_failed_event {
pub ssfe_type: u16,
pub ssfe_flags: u16,
pub ssfe_length: u32,
pub ssfe_error: u32,
pub ssfe_info: sctp_sndinfo,
pub ssfe_assoc_id: ::sctp_assoc_t,
pub ssfe_data: [u8; 0],
}
pub struct sctp_shutdown_event {
pub sse_type: u16,
pub sse_flags: u16,
pub sse_length: u32,
pub sse_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_adaptation_event {
pub sai_type: u16,
pub sai_flags: u16,
pub sai_length: u32,
pub sai_adaptation_ind: u32,
pub sai_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_setadaptation {
pub ssb_adaptation_ind: u32,
}
pub struct sctp_pdapi_event {
pub pdapi_type: u16,
pub pdapi_flags: u16,
pub pdapi_length: u32,
pub pdapi_indication: u32,
pub pdapi_stream: u16,
pub pdapi_seq: u16,
pub pdapi_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_sender_dry_event {
pub sender_dry_type: u16,
pub sender_dry_flags: u16,
pub sender_dry_length: u32,
pub sender_dry_assoc_id: ::sctp_assoc_t,
}
pub struct sctp_stream_reset_event {
pub strreset_type: u16,
pub strreset_flags: u16,
pub strreset_length: u32,
pub strreset_assoc_id: ::sctp_assoc_t,
pub strreset_stream_list: [u16; 0],
}
pub struct sctp_stream_change_event {
pub strchange_type: u16,
pub strchange_flags: u16,
pub strchange_length: u32,
pub strchange_assoc_id: ::sctp_assoc_t,
pub strchange_instrms: u16,
pub strchange_outstrms: u16,
}
}
s_no_extra_traits! {
pub struct utmpx {
pub ut_type: ::c_short,
pub ut_tv: ::timeval,
pub ut_id: [::c_char; 8],
pub ut_pid: ::pid_t,
pub ut_user: [::c_char; 32],
pub ut_line: [::c_char; 16],
pub ut_host: [::c_char; 128],
pub __ut_spare: [::c_char; 64],
}
#[cfg(libc_union)]
pub union __c_anonymous_cr_pid {
__cr_unused: *mut ::c_void,
pub cr_pid: ::pid_t,
}
pub struct xucred {
pub cr_version: ::c_uint,
pub cr_uid: ::uid_t,
pub cr_ngroups: ::c_short,
pub cr_groups: [::gid_t; 16],
#[cfg(libc_union)]
pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid,
#[cfg(not(libc_union))]
__cr_unused1: *mut ::c_void,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 46],
}
pub struct mq_attr {
pub mq_flags: ::c_long,
pub mq_maxmsg: ::c_long,
pub mq_msgsize: ::c_long,
pub mq_curmsgs: ::c_long,
__reserved: [::c_long; 4]
}
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::sigval,
//The rest of the structure is actually a union. We expose only
//sigev_notify_thread_id because it's the most useful union member.
pub sigev_notify_thread_id: ::lwpid_t,
#[cfg(target_pointer_width = "64")]
__unused1: ::c_int,
__unused2: [::c_long; 7]
}
pub struct ptsstat {
#[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))]
pub dev: u64,
#[cfg(not(any(freebsd12, freebsd13, freebsd14, freebsd15)))]
pub dev: u32,
pub devname: [::c_char; SPECNAMELEN as usize + 1],
}
#[cfg(libc_union)]
pub union __c_anonymous_elf32_auxv_union {
pub a_val: ::c_int,
}
pub struct Elf32_Auxinfo {
pub a_type: ::c_int,
#[cfg(libc_union)]
pub a_un: __c_anonymous_elf32_auxv_union,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifi_epoch {
pub tt: ::time_t,
pub ph: u64,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifi_lastchange {
pub tv: ::timeval,
pub ph: __c_anonymous_ph,
}
pub struct if_data {
/// ethernet, tokenring, etc
pub ifi_type: u8,
/// e.g., AUI, Thinnet, 10base-T, etc
pub ifi_physical: u8,
/// media address length
pub ifi_addrlen: u8,
/// media header length
pub ifi_hdrlen: u8,
/// current link state
pub ifi_link_state: u8,
/// carp vhid
pub ifi_vhid: u8,
/// length of this data struct
pub ifi_datalen: u16,
/// maximum transmission unit
pub ifi_mtu: u32,
/// routing metric (external only)
pub ifi_metric: u32,
/// linespeed
pub ifi_baudrate: u64,
/// packets received on interface
pub ifi_ipackets: u64,
/// input errors on interface
pub ifi_ierrors: u64,
/// packets sent on interface
pub ifi_opackets: u64,
/// output errors on interface
pub ifi_oerrors: u64,
/// collisions on csma interfaces
pub ifi_collisions: u64,
/// total number of octets received
pub ifi_ibytes: u64,
/// total number of octets sent
pub ifi_obytes: u64,
/// packets received via multicast
pub ifi_imcasts: u64,
/// packets sent via multicast
pub ifi_omcasts: u64,
/// dropped on input
pub ifi_iqdrops: u64,
/// dropped on output
pub ifi_oqdrops: u64,
/// destined for unsupported protocol
pub ifi_noproto: u64,
/// HW offload capabilities, see IFCAP
pub ifi_hwassist: u64,
/// uptime at attach or stat reset
#[cfg(libc_union)]
pub __ifi_epoch: __c_anonymous_ifi_epoch,
/// uptime at attach or stat reset
#[cfg(not(libc_union))]
pub __ifi_epoch: u64,
/// time of last administrative change
#[cfg(libc_union)]
pub __ifi_lastchange: __c_anonymous_ifi_lastchange,
/// time of last administrative change
#[cfg(not(libc_union))]
pub __ifi_lastchange: ::timeval,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: ::sockaddr,
pub ifru_dstaddr: ::sockaddr,
pub ifru_broadaddr: ::sockaddr,
pub ifru_buffer: ifreq_buffer,
pub ifru_flags: [::c_short; 2],
pub ifru_index: ::c_short,
pub ifru_jid: ::c_int,
pub ifru_metric: ::c_int,
pub ifru_mtu: ::c_int,
pub ifru_phys: ::c_int,
pub ifru_media: ::c_int,
pub ifru_data: ::caddr_t,
pub ifru_cap: [::c_int; 2],
pub ifru_fib: ::c_uint,
pub ifru_vlan_pcp: ::c_uchar,
}
pub struct ifreq {
/// if name, e.g. "en0"
pub ifr_name: [::c_char; ::IFNAMSIZ],
#[cfg(libc_union)]
pub ifr_ifru: __c_anonymous_ifr_ifru,
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifc_ifcu {
pub ifcu_buf: ::caddr_t,
pub ifcu_req: *mut ifreq,
}
pub struct ifstat {
/// if name, e.g. "en0"
pub ifs_name: [::c_char; ::IFNAMSIZ as usize],
pub ascii: [::c_char; ::IFSTATMAX as usize + 1],
}
pub struct ifrsskey {
/// if name, e.g. "en0"
pub ifrk_name: [::c_char; ::IFNAMSIZ as usize],
/// RSS_FUNC_
pub ifrk_func: u8,
pub ifrk_spare0: u8,
pub ifrk_keylen: u16,
pub ifrk_key: [u8; ::RSS_KEYLEN as usize],
}
pub struct ifdownreason {
pub ifdr_name: [::c_char; ::IFNAMSIZ as usize],
pub ifdr_reason: u32,
pub ifdr_vendor: u32,
pub ifdr_msg: [::c_char; ::IFDR_MSG_SIZE as usize],
}
#[repr(packed)]
pub struct sctphdr {
pub src_port: u16,
pub dest_port: u16,
pub v_tag: u32,
pub checksum: u32,
}
#[repr(packed)]
pub struct sctp_chunkhdr {
pub chunk_type: u8,
pub chunk_flags: u8,
pub chunk_length: u16,
}
#[repr(packed)]
pub struct sctp_paramhdr {
pub param_type: u16,
pub param_length: u16,
}
#[repr(packed)]
pub struct sctp_gen_error_cause {
pub code: u16,
pub length: u16,
pub info: [u8; 0],
}
#[repr(packed)]
pub struct sctp_error_cause {
pub code: u16,
pub length: u16,
}
#[repr(packed)]
pub struct sctp_error_invalid_stream {
pub cause: sctp_error_cause,
pub stream_id: u16,
__reserved: u16,
}
#[repr(packed)]
pub struct sctp_error_missing_param {
pub cause: sctp_error_cause,
pub num_missing_params: u32,
pub tpe: [u8; 0],
}
#[repr(packed)]
pub struct sctp_error_stale_cookie {
pub cause: sctp_error_cause,
pub stale_time: u32,
}
#[repr(packed)]
pub struct sctp_error_out_of_resource {
pub cause: sctp_error_cause,
}
#[repr(packed)]
pub struct sctp_error_unresolv_addr {
pub cause: sctp_error_cause,
}
#[repr(packed)]
pub struct sctp_error_unrecognized_chunk {
pub cause: sctp_error_cause,
pub ch: sctp_chunkhdr,
}
#[repr(packed)]
pub struct sctp_error_no_user_data {
pub cause: sctp_error_cause,
pub tsn: u32,
}
#[repr(packed)]
pub struct sctp_error_auth_invalid_hmac {
pub cause: sctp_error_cause,
pub hmac_id: u16,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for utmpx {
fn eq(&self, other: &utmpx) -> bool {
self.ut_type == other.ut_type
&& self.ut_tv == other.ut_tv
&& self.ut_id == other.ut_id
&& self.ut_pid == other.ut_pid
&& self.ut_user == other.ut_user
&& self.ut_line == other.ut_line
&& self
.ut_host
.iter()
.zip(other.ut_host.iter())
.all(|(a,b)| a == b)
&& self
.__ut_spare
.iter()
.zip(other.__ut_spare.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for utmpx {}
impl ::fmt::Debug for utmpx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utmpx")
.field("ut_type", &self.ut_type)
.field("ut_tv", &self.ut_tv)
.field("ut_id", &self.ut_id)
.field("ut_pid", &self.ut_pid)
.field("ut_user", &self.ut_user)
.field("ut_line", &self.ut_line)
// FIXME: .field("ut_host", &self.ut_host)
// FIXME: .field("__ut_spare", &self.__ut_spare)
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash(&self, state: &mut H) {
self.ut_type.hash(state);
self.ut_tv.hash(state);
self.ut_id.hash(state);
self.ut_pid.hash(state);
self.ut_user.hash(state);
self.ut_line.hash(state);
self.ut_host.hash(state);
self.__ut_spare.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_cr_pid {
fn eq(&self, other: &__c_anonymous_cr_pid) -> bool {
unsafe { self.cr_pid == other.cr_pid}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_cr_pid {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_cr_pid {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("cr_pid")
.field("cr_pid", unsafe { &self.cr_pid })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_cr_pid {
fn hash(&self, state: &mut H) {
unsafe { self.cr_pid.hash(state) };
}
}
impl PartialEq for xucred {
fn eq(&self, other: &xucred) -> bool {
#[cfg(libc_union)]
let equal_cr_pid = self.cr_pid__c_anonymous_union
== other.cr_pid__c_anonymous_union;
#[cfg(not(libc_union))]
let equal_cr_pid = self.__cr_unused1 == other.__cr_unused1;
self.cr_version == other.cr_version
&& self.cr_uid == other.cr_uid
&& self.cr_ngroups == other.cr_ngroups
&& self.cr_groups == other.cr_groups
&& equal_cr_pid
}
}
impl Eq for xucred {}
impl ::fmt::Debug for xucred {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let mut struct_formatter = f.debug_struct("xucred");
struct_formatter.field("cr_version", &self.cr_version);
struct_formatter.field("cr_uid", &self.cr_uid);
struct_formatter.field("cr_ngroups", &self.cr_ngroups);
struct_formatter.field("cr_groups", &self.cr_groups);
#[cfg(libc_union)]
struct_formatter.field(
"cr_pid__c_anonymous_union",
&self.cr_pid__c_anonymous_union
);
struct_formatter.finish()
}
}
impl ::hash::Hash for xucred {
fn hash(&self, state: &mut H) {
self.cr_version.hash(state);
self.cr_uid.hash(state);
self.cr_ngroups.hash(state);
self.cr_groups.hash(state);
#[cfg(libc_union)]
self.cr_pid__c_anonymous_union.hash(state);
#[cfg(not(libc_union))]
self.__cr_unused1.hash(state);
}
}
impl PartialEq for sockaddr_dl {
fn eq(&self, other: &sockaddr_dl) -> bool {
self.sdl_len == other.sdl_len
&& self.sdl_family == other.sdl_family
&& self.sdl_index == other.sdl_index
&& self.sdl_type == other.sdl_type
&& self.sdl_nlen == other.sdl_nlen
&& self.sdl_alen == other.sdl_alen
&& self.sdl_slen == other.sdl_slen
&& self
.sdl_data
.iter()
.zip(other.sdl_data.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sockaddr_dl {}
impl ::fmt::Debug for sockaddr_dl {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_dl")
.field("sdl_len", &self.sdl_len)
.field("sdl_family", &self.sdl_family)
.field("sdl_index", &self.sdl_index)
.field("sdl_type", &self.sdl_type)
.field("sdl_nlen", &self.sdl_nlen)
.field("sdl_alen", &self.sdl_alen)
.field("sdl_slen", &self.sdl_slen)
// FIXME: .field("sdl_data", &self.sdl_data)
.finish()
}
}
impl ::hash::Hash for sockaddr_dl {
fn hash(&self, state: &mut H) {
self.sdl_len.hash(state);
self.sdl_family.hash(state);
self.sdl_index.hash(state);
self.sdl_type.hash(state);
self.sdl_nlen.hash(state);
self.sdl_alen.hash(state);
self.sdl_slen.hash(state);
self.sdl_data.hash(state);
}
}
impl PartialEq for mq_attr {
fn eq(&self, other: &mq_attr) -> bool {
self.mq_flags == other.mq_flags &&
self.mq_maxmsg == other.mq_maxmsg &&
self.mq_msgsize == other.mq_msgsize &&
self.mq_curmsgs == other.mq_curmsgs
}
}
impl Eq for mq_attr {}
impl ::fmt::Debug for mq_attr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mq_attr")
.field("mq_flags", &self.mq_flags)
.field("mq_maxmsg", &self.mq_maxmsg)
.field("mq_msgsize", &self.mq_msgsize)
.field("mq_curmsgs", &self.mq_curmsgs)
.finish()
}
}
impl ::hash::Hash for mq_attr {
fn hash(&self, state: &mut H) {
self.mq_flags.hash(state);
self.mq_maxmsg.hash(state);
self.mq_msgsize.hash(state);
self.mq_curmsgs.hash(state);
}
}
impl PartialEq for sigevent {
fn eq(&self, other: &sigevent) -> bool {
self.sigev_notify == other.sigev_notify
&& self.sigev_signo == other.sigev_signo
&& self.sigev_value == other.sigev_value
&& self.sigev_notify_thread_id
== other.sigev_notify_thread_id
}
}
impl Eq for sigevent {}
impl ::fmt::Debug for sigevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigevent")
.field("sigev_notify", &self.sigev_notify)
.field("sigev_signo", &self.sigev_signo)
.field("sigev_value", &self.sigev_value)
.field("sigev_notify_thread_id",
&self.sigev_notify_thread_id)
.finish()
}
}
impl ::hash::Hash for sigevent {
fn hash(&self, state: &mut H) {
self.sigev_notify.hash(state);
self.sigev_signo.hash(state);
self.sigev_value.hash(state);
self.sigev_notify_thread_id.hash(state);
}
}
impl PartialEq for ptsstat {
fn eq(&self, other: &ptsstat) -> bool {
let self_devname: &[::c_char] = &self.devname;
let other_devname: &[::c_char] = &other.devname;
self.dev == other.dev && self_devname == other_devname
}
}
impl Eq for ptsstat {}
impl ::fmt::Debug for ptsstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let self_devname: &[::c_char] = &self.devname;
f.debug_struct("ptsstat")
.field("dev", &self.dev)
.field("devname", &self_devname)
.finish()
}
}
impl ::hash::Hash for ptsstat {
fn hash(&self, state: &mut H) {
let self_devname: &[::c_char] = &self.devname;
self.dev.hash(state);
self_devname.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_elf32_auxv_union {
fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool {
unsafe { self.a_val == other.a_val}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_elf32_auxv_union {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_elf32_auxv_union {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("a_val")
.field("a_val", unsafe { &self.a_val })
.finish()
}
}
#[cfg(not(libc_union))]
impl PartialEq for Elf32_Auxinfo {
fn eq(&self, other: &Elf32_Auxinfo) -> bool {
self.a_type == other.a_type
}
}
#[cfg(libc_union)]
impl PartialEq for Elf32_Auxinfo {
fn eq(&self, other: &Elf32_Auxinfo) -> bool {
self.a_type == other.a_type
&& self.a_un == other.a_un
}
}
impl Eq for Elf32_Auxinfo {}
#[cfg(not(libc_union))]
impl ::fmt::Debug for Elf32_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf32_Auxinfo")
.field("a_type", &self.a_type)
.finish()
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for Elf32_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf32_Auxinfo")
.field("a_type", &self.a_type)
.field("a_un", &self.a_un)
.finish()
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifr_ifru {
fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool {
unsafe {
self.ifru_addr == other.ifru_addr &&
self.ifru_dstaddr == other.ifru_dstaddr &&
self.ifru_broadaddr == other.ifru_broadaddr &&
self.ifru_buffer == other.ifru_buffer &&
self.ifru_flags == other.ifru_flags &&
self.ifru_index == other.ifru_index &&
self.ifru_jid == other.ifru_jid &&
self.ifru_metric == other.ifru_metric &&
self.ifru_mtu == other.ifru_mtu &&
self.ifru_phys == other.ifru_phys &&
self.ifru_media == other.ifru_media &&
self.ifru_data == other.ifru_data &&
self.ifru_cap == other.ifru_cap &&
self.ifru_fib == other.ifru_fib &&
self.ifru_vlan_pcp == other.ifru_vlan_pcp
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifr_ifru {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifr_ifru {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifr_ifru")
.field("ifru_addr", unsafe { &self.ifru_addr })
.field("ifru_dstaddr", unsafe { &self.ifru_dstaddr })
.field("ifru_broadaddr", unsafe { &self.ifru_broadaddr })
.field("ifru_buffer", unsafe { &self.ifru_buffer })
.field("ifru_flags", unsafe { &self.ifru_flags })
.field("ifru_index", unsafe { &self.ifru_index })
.field("ifru_jid", unsafe { &self.ifru_jid })
.field("ifru_metric", unsafe { &self.ifru_metric })
.field("ifru_mtu", unsafe { &self.ifru_mtu })
.field("ifru_phys", unsafe { &self.ifru_phys })
.field("ifru_media", unsafe { &self.ifru_media })
.field("ifru_data", unsafe { &self.ifru_data })
.field("ifru_cap", unsafe { &self.ifru_cap })
.field("ifru_fib", unsafe { &self.ifru_fib })
.field("ifru_vlan_pcp", unsafe { &self.ifru_vlan_pcp })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifr_ifru {
fn hash(&self, state: &mut H) {
unsafe { self.ifru_addr.hash(state) };
unsafe { self.ifru_dstaddr.hash(state) };
unsafe { self.ifru_broadaddr.hash(state) };
unsafe { self.ifru_buffer.hash(state) };
unsafe { self.ifru_flags.hash(state) };
unsafe { self.ifru_index.hash(state) };
unsafe { self.ifru_jid.hash(state) };
unsafe { self.ifru_metric.hash(state) };
unsafe { self.ifru_mtu.hash(state) };
unsafe { self.ifru_phys.hash(state) };
unsafe { self.ifru_media.hash(state) };
unsafe { self.ifru_data.hash(state) };
unsafe { self.ifru_cap.hash(state) };
unsafe { self.ifru_fib.hash(state) };
unsafe { self.ifru_vlan_pcp.hash(state) };
}
}
impl PartialEq for ifreq {
fn eq(&self, other: &ifreq) -> bool {
self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru
}
}
impl Eq for ifreq {}
impl ::fmt::Debug for ifreq {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifreq")
.field("ifr_name", &self.ifr_name)
.field("ifr_ifru", &self.ifr_ifru)
.finish()
}
}
impl ::hash::Hash for ifreq {
fn hash(&self, state: &mut H) {
self.ifr_name.hash(state);
self.ifr_ifru.hash(state);
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifc_ifcu {}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifc_ifcu {
fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
unsafe {
self.ifcu_buf == other.ifcu_buf &&
self.ifcu_req == other.ifcu_req
}
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ifc_ifcu")
.field("ifcu_buf", unsafe { &self.ifcu_buf })
.field("ifcu_req", unsafe { &self.ifcu_req })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifc_ifcu {
fn hash(&self, state: &mut H) {
unsafe { self.ifcu_buf.hash(state) };
unsafe { self.ifcu_req.hash(state) };
}
}
impl PartialEq for ifstat {
fn eq(&self, other: &ifstat) -> bool {
let self_ascii: &[::c_char] = &self.ascii;
let other_ascii: &[::c_char] = &other.ascii;
self.ifs_name == other.ifs_name && self_ascii == other_ascii
}
}
impl Eq for ifstat {}
impl ::fmt::Debug for ifstat {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ascii: &[::c_char] = &self.ascii;
f.debug_struct("ifstat")
.field("ifs_name", &self.ifs_name)
.field("ascii", &ascii)
.finish()
}
}
impl ::hash::Hash for ifstat {
fn hash(&self, state: &mut H) {
self.ifs_name.hash(state);
self.ascii.hash(state);
}
}
impl PartialEq for ifrsskey {
fn eq(&self, other: &ifrsskey) -> bool {
let self_ifrk_key: &[u8] = &self.ifrk_key;
let other_ifrk_key: &[u8] = &other.ifrk_key;
self.ifrk_name == other.ifrk_name &&
self.ifrk_func == other.ifrk_func &&
self.ifrk_spare0 == other.ifrk_spare0 &&
self.ifrk_keylen == other.ifrk_keylen &&
self_ifrk_key == other_ifrk_key
}
}
impl Eq for ifrsskey {}
impl ::fmt::Debug for ifrsskey {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ifrk_key: &[u8] = &self.ifrk_key;
f.debug_struct("ifrsskey")
.field("ifrk_name", &self.ifrk_name)
.field("ifrk_func", &self.ifrk_func)
.field("ifrk_spare0", &self.ifrk_spare0)
.field("ifrk_keylen", &self.ifrk_keylen)
.field("ifrk_key", &ifrk_key)
.finish()
}
}
impl ::hash::Hash for ifrsskey {
fn hash(&self, state: &mut H) {
self.ifrk_name.hash(state);
self.ifrk_func.hash(state);
self.ifrk_spare0.hash(state);
self.ifrk_keylen.hash(state);
self.ifrk_key.hash(state);
}
}
impl PartialEq for ifdownreason {
fn eq(&self, other: &ifdownreason) -> bool {
let self_ifdr_msg: &[::c_char] = &self.ifdr_msg;
let other_ifdr_msg: &[::c_char] = &other.ifdr_msg;
self.ifdr_name == other.ifdr_name &&
self.ifdr_reason == other.ifdr_reason &&
self.ifdr_vendor == other.ifdr_vendor &&
self_ifdr_msg == other_ifdr_msg
}
}
impl Eq for ifdownreason {}
impl ::fmt::Debug for ifdownreason {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ifdr_msg: &[::c_char] = &self.ifdr_msg;
f.debug_struct("ifdownreason")
.field("ifdr_name", &self.ifdr_name)
.field("ifdr_reason", &self.ifdr_reason)
.field("ifdr_vendor", &self.ifdr_vendor)
.field("ifdr_msg", &ifdr_msg)
.finish()
}
}
impl ::hash::Hash for ifdownreason {
fn hash(&self, state: &mut H) {
self.ifdr_name.hash(state);
self.ifdr_reason.hash(state);
self.ifdr_vendor.hash(state);
self.ifdr_msg.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifi_epoch {
fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool {
unsafe {
self.tt == other.tt &&
self.ph == other.ph
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifi_epoch {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifi_epoch {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__c_anonymous_ifi_epoch")
.field("tt", unsafe { &self.tt })
.field("ph", unsafe { &self.ph })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifi_epoch {
fn hash(&self, state: &mut H) {
unsafe {
self.tt.hash(state);
self.ph.hash(state);
}
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifi_lastchange {
fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool {
unsafe {
self.tv == other.tv &&
self.ph == other.ph
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifi_lastchange {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifi_lastchange {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("__c_anonymous_ifi_lastchange")
.field("tv", unsafe { &self.tv })
.field("ph", unsafe { &self.ph })
.finish()
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifi_lastchange {
fn hash(&self, state: &mut H) {
unsafe {
self.tv.hash(state);
self.ph.hash(state);
}
}
}
impl PartialEq for if_data {
fn eq(&self, other: &if_data) -> bool {
self.ifi_type == other.ifi_type &&
self.ifi_physical == other.ifi_physical &&
self.ifi_addrlen == other.ifi_addrlen &&
self.ifi_hdrlen == other.ifi_hdrlen &&
self.ifi_link_state == other.ifi_link_state &&
self.ifi_vhid == other.ifi_vhid &&
self.ifi_datalen == other.ifi_datalen &&
self.ifi_mtu == other.ifi_mtu &&
self.ifi_metric == other.ifi_metric &&
self.ifi_baudrate == other.ifi_baudrate &&
self.ifi_ipackets == other.ifi_ipackets &&
self.ifi_ierrors == other.ifi_ierrors &&
self.ifi_opackets == other.ifi_opackets &&
self.ifi_oerrors == other.ifi_oerrors &&
self.ifi_collisions == other.ifi_collisions &&
self.ifi_ibytes == other.ifi_ibytes &&
self.ifi_obytes == other.ifi_obytes &&
self.ifi_imcasts == other.ifi_imcasts &&
self.ifi_omcasts == other.ifi_omcasts &&
self.ifi_iqdrops == other.ifi_iqdrops &&
self.ifi_oqdrops == other.ifi_oqdrops &&
self.ifi_noproto == other.ifi_noproto &&
self.ifi_hwassist == other.ifi_hwassist &&
self.__ifi_epoch == other.__ifi_epoch &&
self.__ifi_lastchange == other.__ifi_lastchange
}
}
impl Eq for if_data {}
impl ::fmt::Debug for if_data {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("if_data")
.field("ifi_type", &self.ifi_type)
.field("ifi_physical", &self.ifi_physical)
.field("ifi_addrlen", &self.ifi_addrlen)
.field("ifi_hdrlen", &self.ifi_hdrlen)
.field("ifi_link_state", &self.ifi_link_state)
.field("ifi_vhid", &self.ifi_vhid)
.field("ifi_datalen", &self.ifi_datalen)
.field("ifi_mtu", &self.ifi_mtu)
.field("ifi_metric", &self.ifi_metric)
.field("ifi_baudrate", &self.ifi_baudrate)
.field("ifi_ipackets", &self.ifi_ipackets)
.field("ifi_ierrors", &self.ifi_ierrors)
.field("ifi_opackets", &self.ifi_opackets)
.field("ifi_oerrors", &self.ifi_oerrors)
.field("ifi_collisions", &self.ifi_collisions)
.field("ifi_ibytes", &self.ifi_ibytes)
.field("ifi_obytes", &self.ifi_obytes)
.field("ifi_imcasts", &self.ifi_imcasts)
.field("ifi_omcasts", &self.ifi_omcasts)
.field("ifi_iqdrops", &self.ifi_iqdrops)
.field("ifi_oqdrops", &self.ifi_oqdrops)
.field("ifi_noproto", &self.ifi_noproto)
.field("ifi_hwassist", &self.ifi_hwassist)
.field("__ifi_epoch", &self.__ifi_epoch)
.field("__ifi_lastchange", &self.__ifi_lastchange)
.finish()
}
}
impl ::hash::Hash for if_data {
fn hash(&self, state: &mut H) {
self.ifi_type.hash(state);
self.ifi_physical.hash(state);
self.ifi_addrlen.hash(state);
self.ifi_hdrlen.hash(state);
self.ifi_link_state.hash(state);
self.ifi_vhid.hash(state);
self.ifi_datalen.hash(state);
self.ifi_mtu.hash(state);
self.ifi_metric.hash(state);
self.ifi_baudrate.hash(state);
self.ifi_ipackets.hash(state);
self.ifi_ierrors.hash(state);
self.ifi_opackets.hash(state);
self.ifi_oerrors.hash(state);
self.ifi_collisions.hash(state);
self.ifi_ibytes.hash(state);
self.ifi_obytes.hash(state);
self.ifi_imcasts.hash(state);
self.ifi_omcasts.hash(state);
self.ifi_iqdrops.hash(state);
self.ifi_oqdrops.hash(state);
self.ifi_noproto.hash(state);
self.ifi_hwassist.hash(state);
self.__ifi_epoch.hash(state);
self.__ifi_lastchange.hash(state);
}
}
impl PartialEq for sctphdr {
fn eq(&self, other: &sctphdr) -> bool {
return {self.src_port} == {other.src_port} &&
{self.dest_port} == {other.dest_port} &&
{self.v_tag} == {other.v_tag} &&
{self.checksum} == {other.checksum}
}
}
impl Eq for sctphdr {}
impl ::fmt::Debug for sctphdr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctphdr")
.field("src_port", &{self.src_port})
.field("dest_port", &{self.dest_port})
.field("v_tag", &{self.v_tag})
.field("checksum", &{self.checksum})
.finish()
}
}
impl ::hash::Hash for sctphdr {
fn hash(&self, state: &mut H) {
{self.src_port}.hash(state);
{self.dest_port}.hash(state);
{self.v_tag}.hash(state);
{self.checksum}.hash(state);
}
}
impl PartialEq for sctp_chunkhdr {
fn eq(&self, other: &sctp_chunkhdr) -> bool {
return {self.chunk_type} == {other.chunk_type} &&
{self.chunk_flags} == {other.chunk_flags} &&
{self.chunk_length} == {other.chunk_length}
}
}
impl Eq for sctp_chunkhdr {}
impl ::fmt::Debug for sctp_chunkhdr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_chunkhdr")
.field("chunk_type", &{self.chunk_type})
.field("chunk_flags", &{self.chunk_flags})
.field("chunk_length", &{self.chunk_length})
.finish()
}
}
impl ::hash::Hash for sctp_chunkhdr {
fn hash(&self, state: &mut H) {
{self.chunk_type}.hash(state);
{self.chunk_flags}.hash(state);
{self.chunk_length}.hash(state);
}
}
impl PartialEq for sctp_paramhdr {
fn eq(&self, other: &sctp_paramhdr) -> bool {
return {self.param_type} == {other.param_type} &&
{self.param_length} == {other.param_length}
}
}
impl Eq for sctp_paramhdr {}
impl ::fmt::Debug for sctp_paramhdr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_paramhdr")
.field("param_type", &{self.param_type})
.field("param_length", &{self.param_length})
.finish()
}
}
impl ::hash::Hash for sctp_paramhdr {
fn hash(&self, state: &mut H) {
{self.param_type}.hash(state);
{self.param_length}.hash(state);
}
}
impl PartialEq for sctp_gen_error_cause {
fn eq(&self, other: &sctp_gen_error_cause) -> bool {
return {self.code} == {other.code} &&
{self.length} == {other.length} &&
{self.info}.iter().zip({other.info}.iter()).all(|(a,b)| a == b)
}
}
impl Eq for sctp_gen_error_cause {}
impl ::fmt::Debug for sctp_gen_error_cause {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_gen_error_cause")
.field("code", &{self.code})
.field("length", &{self.length})
// FIXME: .field("info", &{self.info})
.finish()
}
}
impl ::hash::Hash for sctp_gen_error_cause {
fn hash(&self, state: &mut H) {
{self.code}.hash(state);
{self.length}.hash(state);
{self.info}.hash(state);
}
}
impl PartialEq for sctp_error_cause {
fn eq(&self, other: &sctp_error_cause) -> bool {
return {self.code} == {other.code} &&
{self.length} == {other.length}
}
}
impl Eq for sctp_error_cause {}
impl ::fmt::Debug for sctp_error_cause {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_cause")
.field("code", &{self.code})
.field("length", &{self.length})
.finish()
}
}
impl ::hash::Hash for sctp_error_cause {
fn hash(&self, state: &mut H) {
{self.code}.hash(state);
{self.length}.hash(state);
}
}
impl PartialEq for sctp_error_invalid_stream {
fn eq(&self, other: &sctp_error_invalid_stream) -> bool {
return {self.cause} == {other.cause} &&
{self.stream_id} == {other.stream_id}
}
}
impl Eq for sctp_error_invalid_stream {}
impl ::fmt::Debug for sctp_error_invalid_stream {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_invalid_stream")
.field("cause", &{self.cause})
.field("stream_id", &{self.stream_id})
.finish()
}
}
impl ::hash::Hash for sctp_error_invalid_stream {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.stream_id}.hash(state);
}
}
impl PartialEq for sctp_error_missing_param {
fn eq(&self, other: &sctp_error_missing_param) -> bool {
return {self.cause} == {other.cause} &&
{self.num_missing_params} == {other.num_missing_params} &&
{self.tpe}.iter().zip({other.tpe}.iter()).all(|(a,b)| a == b)
}
}
impl Eq for sctp_error_missing_param {}
impl ::fmt::Debug for sctp_error_missing_param {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_missing_param")
.field("cause", &{self.cause})
.field("num_missing_params", &{self.num_missing_params})
// FIXME: .field("tpe", &{self.tpe})
.finish()
}
}
impl ::hash::Hash for sctp_error_missing_param {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.num_missing_params}.hash(state);
{self.tpe}.hash(state);
}
}
impl PartialEq for sctp_error_stale_cookie {
fn eq(&self, other: &sctp_error_stale_cookie) -> bool {
return {self.cause} == {other.cause} &&
{self.stale_time} == {other.stale_time}
}
}
impl Eq for sctp_error_stale_cookie {}
impl ::fmt::Debug for sctp_error_stale_cookie {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_stale_cookie")
.field("cause", &{self.cause})
.field("stale_time", &{self.stale_time})
.finish()
}
}
impl ::hash::Hash for sctp_error_stale_cookie {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.stale_time}.hash(state);
}
}
impl PartialEq for sctp_error_out_of_resource {
fn eq(&self, other: &sctp_error_out_of_resource) -> bool {
return {self.cause} == {other.cause}
}
}
impl Eq for sctp_error_out_of_resource {}
impl ::fmt::Debug for sctp_error_out_of_resource {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_out_of_resource")
.field("cause", &{self.cause})
.finish()
}
}
impl ::hash::Hash for sctp_error_out_of_resource {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
}
}
impl PartialEq for sctp_error_unresolv_addr {
fn eq(&self, other: &sctp_error_unresolv_addr) -> bool {
return {self.cause} == {other.cause}
}
}
impl Eq for sctp_error_unresolv_addr {}
impl ::fmt::Debug for sctp_error_unresolv_addr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_unresolv_addr")
.field("cause", &{self.cause})
.finish()
}
}
impl ::hash::Hash for sctp_error_unresolv_addr {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
}
}
impl PartialEq for sctp_error_unrecognized_chunk {
fn eq(&self, other: &sctp_error_unrecognized_chunk) -> bool {
return {self.cause} == {other.cause} &&
{self.ch} == {other.ch}
}
}
impl Eq for sctp_error_unrecognized_chunk {}
impl ::fmt::Debug for sctp_error_unrecognized_chunk {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_unrecognized_chunk")
.field("cause", &{self.cause})
.field("ch", &{self.ch})
.finish()
}
}
impl ::hash::Hash for sctp_error_unrecognized_chunk {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.ch}.hash(state);
}
}
impl PartialEq for sctp_error_no_user_data {
fn eq(&self, other: &sctp_error_no_user_data) -> bool {
return {self.cause} == {other.cause} &&
{self.tsn} == {other.tsn}
}
}
impl Eq for sctp_error_no_user_data {}
impl ::fmt::Debug for sctp_error_no_user_data {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_no_user_data")
.field("cause", &{self.cause})
.field("tsn", &{self.tsn})
.finish()
}
}
impl ::hash::Hash for sctp_error_no_user_data {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.tsn}.hash(state);
}
}
impl PartialEq for sctp_error_auth_invalid_hmac {
fn eq(&self, other: &sctp_error_auth_invalid_hmac) -> bool {
return {self.cause} == {other.cause} &&
{self.hmac_id} == {other.hmac_id}
}
}
impl Eq for sctp_error_auth_invalid_hmac {}
impl ::fmt::Debug for sctp_error_auth_invalid_hmac {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sctp_error_invalid_hmac")
.field("cause", &{self.cause})
.field("hmac_id", &{self.hmac_id})
.finish()
}
}
impl ::hash::Hash for sctp_error_auth_invalid_hmac {
fn hash(&self, state: &mut H) {
{self.cause}.hash(state);
{self.hmac_id}.hash(state);
}
}
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
#[repr(u32)]
pub enum dot3Vendors {
dot3VendorAMD = 1,
dot3VendorIntel = 2,
dot3VendorNational = 4,
dot3VendorFujitsu = 5,
dot3VendorDigital = 6,
dot3VendorWesternDigital = 7,
}
impl ::Copy for dot3Vendors {}
impl ::Clone for dot3Vendors {
fn clone(&self) -> dot3Vendors {
*self
}
}
// aio.h
pub const LIO_VECTORED: ::c_int = 4;
pub const LIO_WRITEV: ::c_int = 5;
pub const LIO_READV: ::c_int = 6;
// sys/devicestat.h
pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
pub const DEVSTAT_NAME_LEN: ::c_int = 16;
// sys/cpuset.h
cfg_if! {
if #[cfg(any(freebsd15, freebsd14))] {
pub const CPU_SETSIZE: ::c_int = 1024;
} else {
pub const CPU_SETSIZE: ::c_int = 256;
}
}
pub const SIGEV_THREAD_ID: ::c_int = 4;
pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
pub const PTHREAD_STACK_MIN: ::size_t = MINSIGSTKSZ;
pub const PTHREAD_MUTEX_ADAPTIVE_NP: ::c_int = 4;
pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
pub const SIGSTKSZ: ::size_t = MINSIGSTKSZ + 32768;
pub const SF_NODISKIO: ::c_int = 0x00000001;
pub const SF_MNOWAIT: ::c_int = 0x00000002;
pub const SF_SYNC: ::c_int = 0x00000004;
pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
pub const SF_NOCACHE: ::c_int = 0x00000010;
pub const O_CLOEXEC: ::c_int = 0x00100000;
pub const O_DIRECTORY: ::c_int = 0x00020000;
pub const O_DSYNC: ::c_int = 0x01000000;
pub const O_EMPTY_PATH: ::c_int = 0x02000000;
pub const O_EXEC: ::c_int = 0x00040000;
pub const O_PATH: ::c_int = 0x00400000;
pub const O_RESOLVE_BENEATH: ::c_int = 0x00800000;
pub const O_SEARCH: ::c_int = O_EXEC;
pub const O_TTY_INIT: ::c_int = 0x00080000;
pub const O_VERIFY: ::c_int = 0x00200000;
pub const F_GETLK: ::c_int = 11;
pub const F_SETLK: ::c_int = 12;
pub const F_SETLKW: ::c_int = 13;
pub const ENOTCAPABLE: ::c_int = 93;
pub const ECAPMODE: ::c_int = 94;
pub const ENOTRECOVERABLE: ::c_int = 95;
pub const EOWNERDEAD: ::c_int = 96;
pub const EINTEGRITY: ::c_int = 97;
pub const RLIMIT_NPTS: ::c_int = 11;
pub const RLIMIT_SWAP: ::c_int = 12;
pub const RLIMIT_KQUEUES: ::c_int = 13;
pub const RLIMIT_UMTXP: ::c_int = 14;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::rlim_t = 15;
pub const RLIM_SAVED_MAX: ::rlim_t = ::RLIM_INFINITY;
pub const RLIM_SAVED_CUR: ::rlim_t = ::RLIM_INFINITY;
pub const CP_USER: ::c_int = 0;
pub const CP_NICE: ::c_int = 1;
pub const CP_SYS: ::c_int = 2;
pub const CP_INTR: ::c_int = 3;
pub const CP_IDLE: ::c_int = 4;
pub const CPUSTATES: ::c_int = 5;
pub const NI_NOFQDN: ::c_int = 0x00000001;
pub const NI_NUMERICHOST: ::c_int = 0x00000002;
pub const NI_NAMEREQD: ::c_int = 0x00000004;
pub const NI_NUMERICSERV: ::c_int = 0x00000008;
pub const NI_DGRAM: ::c_int = 0x00000010;
pub const NI_NUMERICSCOPE: ::c_int = 0x00000020;
pub const XU_NGROUPS: ::c_int = 16;
pub const Q_GETQUOTA: ::c_int = 0x700;
pub const Q_SETQUOTA: ::c_int = 0x800;
pub const MAP_GUARD: ::c_int = 0x00002000;
pub const MAP_EXCL: ::c_int = 0x00004000;
pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNED_SUPER: ::c_int = 1 << MAP_ALIGNMENT_SHIFT;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
pub const POSIX_FADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_FADV_WILLNEED: ::c_int = 3;
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
pub const POLLINIGNEOF: ::c_short = 0x2000;
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;
pub const EVFILT_VNODE: i16 = -4;
pub const EVFILT_PROC: i16 = -5;
pub const EVFILT_SIGNAL: i16 = -6;
pub const EVFILT_TIMER: i16 = -7;
pub const EVFILT_PROCDESC: i16 = -8;
pub const EVFILT_FS: i16 = -9;
pub const EVFILT_LIO: i16 = -10;
pub const EVFILT_USER: i16 = -11;
pub const EVFILT_SENDFILE: i16 = -12;
pub const EVFILT_EMPTY: i16 = -13;
pub const EV_ADD: u16 = 0x1;
pub const EV_DELETE: u16 = 0x2;
pub const EV_ENABLE: u16 = 0x4;
pub const EV_DISABLE: u16 = 0x8;
pub const EV_FORCEONESHOT: u16 = 0x100;
pub const EV_KEEPUDATA: u16 = 0x200;
pub const EV_ONESHOT: u16 = 0x10;
pub const EV_CLEAR: u16 = 0x20;
pub const EV_RECEIPT: u16 = 0x40;
pub const EV_DISPATCH: u16 = 0x80;
pub const EV_SYSFLAGS: u16 = 0xf000;
pub const EV_DROP: u16 = 0x1000;
pub const EV_FLAG1: u16 = 0x2000;
pub const EV_FLAG2: u16 = 0x4000;
pub const EV_EOF: u16 = 0x8000;
pub const EV_ERROR: u16 = 0x4000;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
pub const NOTE_FFOR: u32 = 0x80000000;
pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_FILE_POLL: u32 = 0x00000002;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
pub const NOTE_OPEN: u32 = 0x00000080;
pub const NOTE_CLOSE: u32 = 0x00000100;
pub const NOTE_CLOSE_WRITE: u32 = 0x00000200;
pub const NOTE_READ: u32 = 0x00000400;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
pub const NOTE_PDATAMASK: u32 = 0x000fffff;
pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_MSECONDS: u32 = 0x00000002;
pub const NOTE_USECONDS: u32 = 0x00000004;
pub const NOTE_NSECONDS: u32 = 0x00000008;
pub const NOTE_ABSTIME: u32 = 0x00000010;
pub const MADV_PROTECT: ::c_int = 10;
#[doc(hidden)]
#[deprecated(
since = "0.2.72",
note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
)]
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_SYSCTL: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
pub const CTL_NET: ::c_int = 4;
pub const CTL_DEBUG: ::c_int = 5;
pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_P1003_1B: ::c_int = 9;
// sys/sysctl.h
pub const CTL_MAXNAME: ::c_int = 24;
pub const CTLTYPE: ::c_int = 0xf;
pub const CTLTYPE_NODE: ::c_int = 1;
pub const CTLTYPE_INT: ::c_int = 2;
pub const CTLTYPE_STRING: ::c_int = 3;
pub const CTLTYPE_S64: ::c_int = 4;
pub const CTLTYPE_OPAQUE: ::c_int = 5;
pub const CTLTYPE_STRUCT: ::c_int = CTLTYPE_OPAQUE;
pub const CTLTYPE_UINT: ::c_int = 6;
pub const CTLTYPE_LONG: ::c_int = 7;
pub const CTLTYPE_ULONG: ::c_int = 8;
pub const CTLTYPE_U64: ::c_int = 9;
pub const CTLTYPE_U8: ::c_int = 0xa;
pub const CTLTYPE_U16: ::c_int = 0xb;
pub const CTLTYPE_S8: ::c_int = 0xc;
pub const CTLTYPE_S16: ::c_int = 0xd;
pub const CTLTYPE_S32: ::c_int = 0xe;
pub const CTLTYPE_U32: ::c_int = 0xf;
pub const CTLFLAG_RD: ::c_int = 0x80000000;
pub const CTLFLAG_WR: ::c_int = 0x40000000;
pub const CTLFLAG_RW: ::c_int = CTLFLAG_RD | CTLFLAG_WR;
pub const CTLFLAG_DORMANT: ::c_int = 0x20000000;
pub const CTLFLAG_ANYBODY: ::c_int = 0x10000000;
pub const CTLFLAG_SECURE: ::c_int = 0x08000000;
pub const CTLFLAG_PRISON: ::c_int = 0x04000000;
pub const CTLFLAG_DYN: ::c_int = 0x02000000;
pub const CTLFLAG_SKIP: ::c_int = 0x01000000;
pub const CTLMASK_SECURE: ::c_int = 0x00F00000;
pub const CTLFLAG_TUN: ::c_int = 0x00080000;
pub const CTLFLAG_RDTUN: ::c_int = CTLFLAG_RD | CTLFLAG_TUN;
pub const CTLFLAG_RWTUN: ::c_int = CTLFLAG_RW | CTLFLAG_TUN;
pub const CTLFLAG_MPSAFE: ::c_int = 0x00040000;
pub const CTLFLAG_VNET: ::c_int = 0x00020000;
pub const CTLFLAG_DYING: ::c_int = 0x00010000;
pub const CTLFLAG_CAPRD: ::c_int = 0x00008000;
pub const CTLFLAG_CAPWR: ::c_int = 0x00004000;
pub const CTLFLAG_STATS: ::c_int = 0x00002000;
pub const CTLFLAG_NOFETCH: ::c_int = 0x00001000;
pub const CTLFLAG_CAPRW: ::c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR;
pub const CTLFLAG_NEEDGIANT: ::c_int = 0x00000800;
pub const CTLSHIFT_SECURE: ::c_int = 20;
pub const CTLFLAG_SECURE1: ::c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE);
pub const CTLFLAG_SECURE2: ::c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE);
pub const CTLFLAG_SECURE3: ::c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE);
pub const OID_AUTO: ::c_int = -1;
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
pub const CTL_SYSCTL_NAME: ::c_int = 1;
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
pub const CTL_SYSCTL_NEXTNOSKIP: ::c_int = 7;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
pub const KERN_VERSION: ::c_int = 4;
pub const KERN_MAXVNODES: ::c_int = 5;
pub const KERN_MAXPROC: ::c_int = 6;
pub const KERN_MAXFILES: ::c_int = 7;
pub const KERN_ARGMAX: ::c_int = 8;
pub const KERN_SECURELVL: ::c_int = 9;
pub const KERN_HOSTNAME: ::c_int = 10;
pub const KERN_HOSTID: ::c_int = 11;
pub const KERN_CLOCKRATE: ::c_int = 12;
pub const KERN_VNODE: ::c_int = 13;
pub const KERN_PROC: ::c_int = 14;
pub const KERN_FILE: ::c_int = 15;
pub const KERN_PROF: ::c_int = 16;
pub const KERN_POSIX1: ::c_int = 17;
pub const KERN_NGROUPS: ::c_int = 18;
pub const KERN_JOB_CONTROL: ::c_int = 19;
pub const KERN_SAVED_IDS: ::c_int = 20;
pub const KERN_BOOTTIME: ::c_int = 21;
pub const KERN_NISDOMAINNAME: ::c_int = 22;
pub const KERN_UPDATEINTERVAL: ::c_int = 23;
pub const KERN_OSRELDATE: ::c_int = 24;
pub const KERN_NTP_PLL: ::c_int = 25;
pub const KERN_BOOTFILE: ::c_int = 26;
pub const KERN_MAXFILESPERPROC: ::c_int = 27;
pub const KERN_MAXPROCPERUID: ::c_int = 28;
pub const KERN_DUMPDEV: ::c_int = 29;
pub const KERN_IPC: ::c_int = 30;
pub const KERN_DUMMY: ::c_int = 31;
pub const KERN_PS_STRINGS: ::c_int = 32;
pub const KERN_USRSTACK: ::c_int = 33;
pub const KERN_LOGSIGEXIT: ::c_int = 34;
pub const KERN_IOV_MAX: ::c_int = 35;
pub const KERN_HOSTUUID: ::c_int = 36;
pub const KERN_ARND: ::c_int = 37;
pub const KERN_MAXPHYS: ::c_int = 38;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
pub const KERN_PROC_SESSION: ::c_int = 3;
pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_ARGS: ::c_int = 7;
pub const KERN_PROC_PROC: ::c_int = 8;
pub const KERN_PROC_SV_NAME: ::c_int = 9;
pub const KERN_PROC_RGID: ::c_int = 10;
pub const KERN_PROC_GID: ::c_int = 11;
pub const KERN_PROC_PATHNAME: ::c_int = 12;
pub const KERN_PROC_OVMMAP: ::c_int = 13;
pub const KERN_PROC_OFILEDESC: ::c_int = 14;
pub const KERN_PROC_KSTACK: ::c_int = 15;
pub const KERN_PROC_INC_THREAD: ::c_int = 0x10;
pub const KERN_PROC_VMMAP: ::c_int = 32;
pub const KERN_PROC_FILEDESC: ::c_int = 33;
pub const KERN_PROC_GROUPS: ::c_int = 34;
pub const KERN_PROC_ENV: ::c_int = 35;
pub const KERN_PROC_AUXV: ::c_int = 36;
pub const KERN_PROC_RLIMIT: ::c_int = 37;
pub const KERN_PROC_PS_STRINGS: ::c_int = 38;
pub const KERN_PROC_UMASK: ::c_int = 39;
pub const KERN_PROC_OSREL: ::c_int = 40;
pub const KERN_PROC_SIGTRAMP: ::c_int = 41;
pub const KERN_PROC_CWD: ::c_int = 42;
pub const KERN_PROC_NFDS: ::c_int = 43;
pub const KERN_PROC_SIGFASTBLK: ::c_int = 44;
pub const KIPC_MAXSOCKBUF: ::c_int = 1;
pub const KIPC_SOCKBUF_WASTE: ::c_int = 2;
pub const KIPC_SOMAXCONN: ::c_int = 3;
pub const KIPC_MAX_LINKHDR: ::c_int = 4;
pub const KIPC_MAX_PROTOHDR: ::c_int = 5;
pub const KIPC_MAX_HDR: ::c_int = 6;
pub const KIPC_MAX_DATALEN: ::c_int = 7;
pub const HW_MACHINE: ::c_int = 1;
pub const HW_MODEL: ::c_int = 2;
pub const HW_NCPU: ::c_int = 3;
pub const HW_BYTEORDER: ::c_int = 4;
pub const HW_PHYSMEM: ::c_int = 5;
pub const HW_USERMEM: ::c_int = 6;
pub const HW_PAGESIZE: ::c_int = 7;
pub const HW_DISKNAMES: ::c_int = 8;
pub const HW_DISKSTATS: ::c_int = 9;
pub const HW_FLOATINGPT: ::c_int = 10;
pub const HW_MACHINE_ARCH: ::c_int = 11;
pub const HW_REALMEM: ::c_int = 12;
pub const USER_CS_PATH: ::c_int = 1;
pub const USER_BC_BASE_MAX: ::c_int = 2;
pub const USER_BC_DIM_MAX: ::c_int = 3;
pub const USER_BC_SCALE_MAX: ::c_int = 4;
pub const USER_BC_STRING_MAX: ::c_int = 5;
pub const USER_COLL_WEIGHTS_MAX: ::c_int = 6;
pub const USER_EXPR_NEST_MAX: ::c_int = 7;
pub const USER_LINE_MAX: ::c_int = 8;
pub const USER_RE_DUP_MAX: ::c_int = 9;
pub const USER_POSIX2_VERSION: ::c_int = 10;
pub const USER_POSIX2_C_BIND: ::c_int = 11;
pub const USER_POSIX2_C_DEV: ::c_int = 12;
pub const USER_POSIX2_CHAR_TERM: ::c_int = 13;
pub const USER_POSIX2_FORT_DEV: ::c_int = 14;
pub const USER_POSIX2_FORT_RUN: ::c_int = 15;
pub const USER_POSIX2_LOCALEDEF: ::c_int = 16;
pub const USER_POSIX2_SW_DEV: ::c_int = 17;
pub const USER_POSIX2_UPE: ::c_int = 18;
pub const USER_STREAM_MAX: ::c_int = 19;
pub const USER_TZNAME_MAX: ::c_int = 20;
pub const USER_LOCALBASE: ::c_int = 21;
pub const CTL_P1003_1B_ASYNCHRONOUS_IO: ::c_int = 1;
pub const CTL_P1003_1B_MAPPED_FILES: ::c_int = 2;
pub const CTL_P1003_1B_MEMLOCK: ::c_int = 3;
pub const CTL_P1003_1B_MEMLOCK_RANGE: ::c_int = 4;
pub const CTL_P1003_1B_MEMORY_PROTECTION: ::c_int = 5;
pub const CTL_P1003_1B_MESSAGE_PASSING: ::c_int = 6;
pub const CTL_P1003_1B_PRIORITIZED_IO: ::c_int = 7;
pub const CTL_P1003_1B_PRIORITY_SCHEDULING: ::c_int = 8;
pub const CTL_P1003_1B_REALTIME_SIGNALS: ::c_int = 9;
pub const CTL_P1003_1B_SEMAPHORES: ::c_int = 10;
pub const CTL_P1003_1B_FSYNC: ::c_int = 11;
pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: ::c_int = 12;
pub const CTL_P1003_1B_SYNCHRONIZED_IO: ::c_int = 13;
pub const CTL_P1003_1B_TIMERS: ::c_int = 14;
pub const CTL_P1003_1B_AIO_LISTIO_MAX: ::c_int = 15;
pub const CTL_P1003_1B_AIO_MAX: ::c_int = 16;
pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: ::c_int = 17;
pub const CTL_P1003_1B_DELAYTIMER_MAX: ::c_int = 18;
pub const CTL_P1003_1B_MQ_OPEN_MAX: ::c_int = 19;
pub const CTL_P1003_1B_PAGESIZE: ::c_int = 20;
pub const CTL_P1003_1B_RTSIG_MAX: ::c_int = 21;
pub const CTL_P1003_1B_SEM_NSEMS_MAX: ::c_int = 22;
pub const CTL_P1003_1B_SEM_VALUE_MAX: ::c_int = 23;
pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
pub const TIOCGPTN: ::c_ulong = 0x4004740f;
pub const TIOCPTMASTER: ::c_ulong = 0x2000741c;
pub const TIOCSIG: ::c_ulong = 0x2004745f;
pub const TIOCM_DCD: ::c_int = 0x40;
pub const H4DISC: ::c_int = 0x7;
pub const VM_TOTAL: ::c_int = 1;
pub const BIOCSETFNR: ::c_ulong = 0x80104282;
pub const FIODGNAME: ::c_ulong = 0x80106678;
pub const FIONWRITE: ::c_ulong = 0x40046677;
pub const FIONSPACE: ::c_ulong = 0x40046676;
pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
pub const FIOSSHMLPGCNF: ::c_ulong = 0x80306664;
pub const JAIL_API_VERSION: u32 = 2;
pub const JAIL_CREATE: ::c_int = 0x01;
pub const JAIL_UPDATE: ::c_int = 0x02;
pub const JAIL_ATTACH: ::c_int = 0x04;
pub const JAIL_DYING: ::c_int = 0x08;
pub const JAIL_SET_MASK: ::c_int = 0x0f;
pub const JAIL_GET_MASK: ::c_int = 0x08;
pub const JAIL_SYS_DISABLE: ::c_int = 0;
pub const JAIL_SYS_NEW: ::c_int = 1;
pub const JAIL_SYS_INHERIT: ::c_int = 2;
pub const MNT_ACLS: ::c_int = 0x08000000;
pub const MNT_BYFSID: ::c_int = 0x08000000;
pub const MNT_GJOURNAL: ::c_int = 0x02000000;
pub const MNT_MULTILABEL: ::c_int = 0x04000000;
pub const MNT_NFS4ACLS: ::c_int = 0x00000010;
pub const MNT_SNAPSHOT: ::c_int = 0x01000000;
pub const MNT_UNION: ::c_int = 0x00000020;
pub const MNT_NONBUSY: ::c_int = 0x04000000;
pub const SCM_BINTIME: ::c_int = 0x04;
pub const SCM_REALTIME: ::c_int = 0x05;
pub const SCM_MONOTONIC: ::c_int = 0x06;
pub const SCM_TIME_INFO: ::c_int = 0x07;
pub const SCM_CREDS2: ::c_int = 0x08;
pub const SO_BINTIME: ::c_int = 0x2000;
pub const SO_NO_OFFLOAD: ::c_int = 0x4000;
pub const SO_NO_DDP: ::c_int = 0x8000;
pub const SO_REUSEPORT_LB: ::c_int = 0x10000;
pub const SO_LABEL: ::c_int = 0x1009;
pub const SO_PEERLABEL: ::c_int = 0x1010;
pub const SO_LISTENQLIMIT: ::c_int = 0x1011;
pub const SO_LISTENQLEN: ::c_int = 0x1012;
pub const SO_LISTENINCQLEN: ::c_int = 0x1013;
pub const SO_SETFIB: ::c_int = 0x1014;
pub const SO_USER_COOKIE: ::c_int = 0x1015;
pub const SO_PROTOCOL: ::c_int = 0x1016;
pub const SO_PROTOTYPE: ::c_int = SO_PROTOCOL;
pub const SO_TS_CLOCK: ::c_int = 0x1017;
pub const SO_DOMAIN: ::c_int = 0x1019;
pub const SO_VENDOR: ::c_int = 0x80000000;
pub const SO_TS_REALTIME_MICRO: ::c_int = 0;
pub const SO_TS_BINTIME: ::c_int = 1;
pub const SO_TS_REALTIME: ::c_int = 2;
pub const SO_TS_MONOTONIC: ::c_int = 3;
pub const SO_TS_DEFAULT: ::c_int = SO_TS_REALTIME_MICRO;
pub const SO_TS_CLOCK_MAX: ::c_int = SO_TS_MONOTONIC;
pub const LOCAL_CREDS: ::c_int = 2;
pub const LOCAL_CREDS_PERSISTENT: ::c_int = 3;
pub const LOCAL_CONNWAIT: ::c_int = 4;
pub const LOCAL_VENDOR: ::c_int = SO_VENDOR;
pub const PL_EVENT_NONE: ::c_int = 0;
pub const PL_EVENT_SIGNAL: ::c_int = 1;
pub const PL_FLAG_SA: ::c_int = 0x01;
pub const PL_FLAG_BOUND: ::c_int = 0x02;
pub const PL_FLAG_SCE: ::c_int = 0x04;
pub const PL_FLAG_SCX: ::c_int = 0x08;
pub const PL_FLAG_EXEC: ::c_int = 0x10;
pub const PL_FLAG_SI: ::c_int = 0x20;
pub const PL_FLAG_FORKED: ::c_int = 0x40;
pub const PL_FLAG_CHILD: ::c_int = 0x80;
pub const PL_FLAG_BORN: ::c_int = 0x100;
pub const PL_FLAG_EXITED: ::c_int = 0x200;
pub const PL_FLAG_VFORKED: ::c_int = 0x400;
pub const PL_FLAG_VFORK_DONE: ::c_int = 0x800;
pub const PT_LWPINFO: ::c_int = 13;
pub const PT_GETNUMLWPS: ::c_int = 14;
pub const PT_GETLWPLIST: ::c_int = 15;
pub const PT_CLEARSTEP: ::c_int = 16;
pub const PT_SETSTEP: ::c_int = 17;
pub const PT_SUSPEND: ::c_int = 18;
pub const PT_RESUME: ::c_int = 19;
pub const PT_TO_SCE: ::c_int = 20;
pub const PT_TO_SCX: ::c_int = 21;
pub const PT_SYSCALL: ::c_int = 22;
pub const PT_FOLLOW_FORK: ::c_int = 23;
pub const PT_LWP_EVENTS: ::c_int = 24;
pub const PT_GET_EVENT_MASK: ::c_int = 25;
pub const PT_SET_EVENT_MASK: ::c_int = 26;
pub const PT_GET_SC_ARGS: ::c_int = 27;
pub const PT_GET_SC_RET: ::c_int = 28;
pub const PT_COREDUMP: ::c_int = 29;
pub const PT_GETREGS: ::c_int = 33;
pub const PT_SETREGS: ::c_int = 34;
pub const PT_GETFPREGS: ::c_int = 35;
pub const PT_SETFPREGS: ::c_int = 36;
pub const PT_GETDBREGS: ::c_int = 37;
pub const PT_SETDBREGS: ::c_int = 38;
pub const PT_VM_TIMESTAMP: ::c_int = 40;
pub const PT_VM_ENTRY: ::c_int = 41;
pub const PT_GETREGSET: ::c_int = 42;
pub const PT_SETREGSET: ::c_int = 43;
pub const PT_SC_REMOTE: ::c_int = 44;
pub const PT_FIRSTMACH: ::c_int = 64;
pub const PTRACE_EXEC: ::c_int = 0x0001;
pub const PTRACE_SCE: ::c_int = 0x0002;
pub const PTRACE_SCX: ::c_int = 0x0004;
pub const PTRACE_SYSCALL: ::c_int = PTRACE_SCE | PTRACE_SCX;
pub const PTRACE_FORK: ::c_int = 0x0008;
pub const PTRACE_LWP: ::c_int = 0x0010;
pub const PTRACE_VFORK: ::c_int = 0x0020;
pub const PTRACE_DEFAULT: ::c_int = PTRACE_EXEC;
pub const PC_COMPRESS: u32 = 0x00000001;
pub const PC_ALL: u32 = 0x00000002;
pub const PROC_SPROTECT: ::c_int = 1;
pub const PROC_REAP_ACQUIRE: ::c_int = 2;
pub const PROC_REAP_RELEASE: ::c_int = 3;
pub const PROC_REAP_STATUS: ::c_int = 4;
pub const PROC_REAP_GETPIDS: ::c_int = 5;
pub const PROC_REAP_KILL: ::c_int = 6;
pub const PROC_TRACE_CTL: ::c_int = 7;
pub const PROC_TRACE_STATUS: ::c_int = 8;
pub const PROC_TRAPCAP_CTL: ::c_int = 9;
pub const PROC_TRAPCAP_STATUS: ::c_int = 10;
pub const PROC_PDEATHSIG_CTL: ::c_int = 11;
pub const PROC_PDEATHSIG_STATUS: ::c_int = 12;
pub const PROC_ASLR_CTL: ::c_int = 13;
pub const PROC_ASLR_STATUS: ::c_int = 14;
pub const PROC_PROTMAX_CTL: ::c_int = 15;
pub const PROC_PROTMAX_STATUS: ::c_int = 16;
pub const PROC_STACKGAP_CTL: ::c_int = 17;
pub const PROC_STACKGAP_STATUS: ::c_int = 18;
pub const PROC_NO_NEW_PRIVS_CTL: ::c_int = 19;
pub const PROC_NO_NEW_PRIVS_STATUS: ::c_int = 20;
pub const PROC_WXMAP_CTL: ::c_int = 21;
pub const PROC_WXMAP_STATUS: ::c_int = 22;
pub const PROC_PROCCTL_MD_MIN: ::c_int = 0x10000000;
pub const PPROT_SET: ::c_int = 1;
pub const PPROT_CLEAR: ::c_int = 2;
pub const PPROT_DESCEND: ::c_int = 0x10;
pub const PPROT_INHERIT: ::c_int = 0x20;
pub const PROC_TRACE_CTL_ENABLE: ::c_int = 1;
pub const PROC_TRACE_CTL_DISABLE: ::c_int = 2;
pub const PROC_TRACE_CTL_DISABLE_EXEC: ::c_int = 3;
pub const PROC_TRAPCAP_CTL_ENABLE: ::c_int = 1;
pub const PROC_TRAPCAP_CTL_DISABLE: ::c_int = 2;
pub const PROC_ASLR_FORCE_ENABLE: ::c_int = 1;
pub const PROC_ASLR_FORCE_DISABLE: ::c_int = 2;
pub const PROC_ASLR_NOFORCE: ::c_int = 3;
pub const PROC_ASLR_ACTIVE: ::c_int = 0x80000000;
pub const PROC_PROTMAX_FORCE_ENABLE: ::c_int = 1;
pub const PROC_PROTMAX_FORCE_DISABLE: ::c_int = 2;
pub const PROC_PROTMAX_NOFORCE: ::c_int = 3;
pub const PROC_PROTMAX_ACTIVE: ::c_int = 0x80000000;
pub const PROC_STACKGAP_ENABLE: ::c_int = 0x0001;
pub const PROC_STACKGAP_DISABLE: ::c_int = 0x0002;
pub const PROC_STACKGAP_ENABLE_EXEC: ::c_int = 0x0004;
pub const PROC_STACKGAP_DISABLE_EXEC: ::c_int = 0x0008;
pub const PROC_NO_NEW_PRIVS_ENABLE: ::c_int = 1;
pub const PROC_NO_NEW_PRIVS_DISABLE: ::c_int = 2;
pub const PROC_WX_MAPPINGS_PERMIT: ::c_int = 0x0001;
pub const PROC_WX_MAPPINGS_DISALLOW_EXEC: ::c_int = 0x0002;
pub const PROC_WXORX_ENFORCE: ::c_int = 0x80000000;
pub const AF_SLOW: ::c_int = 33;
pub const AF_SCLUSTER: ::c_int = 34;
pub const AF_ARP: ::c_int = 35;
pub const AF_BLUETOOTH: ::c_int = 36;
pub const AF_IEEE80211: ::c_int = 37;
pub const AF_INET_SDP: ::c_int = 40;
pub const AF_INET6_SDP: ::c_int = 42;
// sys/net/if.h
pub const IF_MAXUNIT: ::c_int = 0x7fff;
/// (n) interface is up
pub const IFF_UP: ::c_int = 0x1;
/// (i) broadcast address valid
pub const IFF_BROADCAST: ::c_int = 0x2;
/// (n) turn on debugging
pub const IFF_DEBUG: ::c_int = 0x4;
/// (i) is a loopback net
pub const IFF_LOOPBACK: ::c_int = 0x8;
/// (i) is a point-to-point link
pub const IFF_POINTOPOINT: ::c_int = 0x10;
/// (i) calls if_input in net epoch
#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
/// (d) resources allocated
pub const IFF_RUNNING: ::c_int = 0x40;
#[doc(hidden)]
#[deprecated(
since = "0.2.54",
note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead"
)]
/// (d) resources allocate
pub const IFF_DRV_RUNNING: ::c_int = 0x40;
/// (n) no address resolution protocol
pub const IFF_NOARP: ::c_int = 0x80;
/// (n) receive all packets
pub const IFF_PROMISC: ::c_int = 0x100;
/// (n) receive all multicast packets
pub const IFF_ALLMULTI: ::c_int = 0x200;
/// (d) tx hardware queue is full
pub const IFF_OACTIVE: ::c_int = 0x400;
#[doc(hidden)]
#[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")]
/// (d) tx hardware queue is full
pub const IFF_DRV_OACTIVE: ::c_int = 0x400;
/// (i) can't hear own transmissions
pub const IFF_SIMPLEX: ::c_int = 0x800;
/// per link layer defined bit
pub const IFF_LINK0: ::c_int = 0x1000;
/// per link layer defined bit
pub const IFF_LINK1: ::c_int = 0x2000;
/// per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000;
/// use alternate physical connection
pub const IFF_ALTPHYS: ::c_int = IFF_LINK2;
/// (i) supports multicast
pub const IFF_MULTICAST: ::c_int = 0x8000;
/// (i) unconfigurable using ioctl(2)
pub const IFF_CANTCONFIG: ::c_int = 0x10000;
/// (n) user-requested promisc mode
pub const IFF_PPROMISC: ::c_int = 0x20000;
/// (n) user-requested monitor mode
pub const IFF_MONITOR: ::c_int = 0x40000;
/// (n) static ARP
pub const IFF_STATICARP: ::c_int = 0x80000;
/// (n) interface is winding down
pub const IFF_DYING: ::c_int = 0x200000;
/// (n) interface is being renamed
pub const IFF_RENAMING: ::c_int = 0x400000;
/// interface is not part of any groups
#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_NOGROUP: ::c_int = 0x800000;
/// link invalid/unknown
pub const LINK_STATE_UNKNOWN: ::c_int = 0;
/// link is down
pub const LINK_STATE_DOWN: ::c_int = 1;
/// link is up
pub const LINK_STATE_UP: ::c_int = 2;
/// can offload checksum on RX
pub const IFCAP_RXCSUM: ::c_int = 0x00001;
/// can offload checksum on TX
pub const IFCAP_TXCSUM: ::c_int = 0x00002;
/// can be a network console
pub const IFCAP_NETCONS: ::c_int = 0x00004;
/// VLAN-compatible MTU
pub const IFCAP_VLAN_MTU: ::c_int = 0x00008;
/// hardware VLAN tag support
pub const IFCAP_VLAN_HWTAGGING: ::c_int = 0x00010;
/// 9000 byte MTU supported
pub const IFCAP_JUMBO_MTU: ::c_int = 0x00020;
/// driver supports polling
pub const IFCAP_POLLING: ::c_int = 0x00040;
/// can do IFCAP_HWCSUM on VLANs
pub const IFCAP_VLAN_HWCSUM: ::c_int = 0x00080;
/// can do TCP Segmentation Offload
pub const IFCAP_TSO4: ::c_int = 0x00100;
/// can do TCP6 Segmentation Offload
pub const IFCAP_TSO6: ::c_int = 0x00200;
/// can do Large Receive Offload
pub const IFCAP_LRO: ::c_int = 0x00400;
/// wake on any unicast frame
pub const IFCAP_WOL_UCAST: ::c_int = 0x00800;
/// wake on any multicast frame
pub const IFCAP_WOL_MCAST: ::c_int = 0x01000;
/// wake on any Magic Packet
pub const IFCAP_WOL_MAGIC: ::c_int = 0x02000;
/// interface can offload TCP
pub const IFCAP_TOE4: ::c_int = 0x04000;
/// interface can offload TCP6
pub const IFCAP_TOE6: ::c_int = 0x08000;
/// interface hw can filter vlan tag
pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
/// can do SIOCGIFCAPNV/SIOCSIFCAPNV
pub const IFCAP_NV: ::c_int = 0x20000;
/// can do IFCAP_TSO on VLANs
pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
/// the runtime link state is dynamic
pub const IFCAP_LINKSTATE: ::c_int = 0x80000;
/// netmap mode supported/enabled
pub const IFCAP_NETMAP: ::c_int = 0x100000;
/// can offload checksum on IPv6 RX
pub const IFCAP_RXCSUM_IPV6: ::c_int = 0x200000;
/// can offload checksum on IPv6 TX
pub const IFCAP_TXCSUM_IPV6: ::c_int = 0x400000;
/// manages counters internally
pub const IFCAP_HWSTATS: ::c_int = 0x800000;
/// hardware supports TX rate limiting
pub const IFCAP_TXRTLMT: ::c_int = 0x1000000;
/// hardware rx timestamping
pub const IFCAP_HWRXTSTMP: ::c_int = 0x2000000;
/// understands M_EXTPG mbufs
pub const IFCAP_MEXTPG: ::c_int = 0x4000000;
/// can do TLS encryption and segmentation for TCP
pub const IFCAP_TXTLS4: ::c_int = 0x8000000;
/// can do TLS encryption and segmentation for TCP6
pub const IFCAP_TXTLS6: ::c_int = 0x10000000;
/// can do IFCAN_HWCSUM on VXLANs
pub const IFCAP_VXLAN_HWCSUM: ::c_int = 0x20000000;
/// can do IFCAP_TSO on VXLANs
pub const IFCAP_VXLAN_HWTSO: ::c_int = 0x40000000;
/// can do TLS with rate limiting
pub const IFCAP_TXTLS_RTLMT: ::c_int = 0x80000000;
pub const IFCAP_HWCSUM_IPV6: ::c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6;
pub const IFCAP_HWCSUM: ::c_int = IFCAP_RXCSUM | IFCAP_TXCSUM;
pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP | IFCAP_NV;
pub const IFQ_MAXLEN: ::c_int = 50;
pub const IFNET_SLOWHZ: ::c_int = 1;
pub const IFAN_ARRIVAL: ::c_int = 0;
pub const IFAN_DEPARTURE: ::c_int = 1;
pub const IFSTATMAX: ::c_int = 800;
pub const RSS_FUNC_NONE: ::c_int = 0;
pub const RSS_FUNC_PRIVATE: ::c_int = 1;
pub const RSS_FUNC_TOEPLITZ: ::c_int = 2;
pub const RSS_TYPE_IPV4: ::c_int = 0x00000001;
pub const RSS_TYPE_TCP_IPV4: ::c_int = 0x00000002;
pub const RSS_TYPE_IPV6: ::c_int = 0x00000004;
pub const RSS_TYPE_IPV6_EX: ::c_int = 0x00000008;
pub const RSS_TYPE_TCP_IPV6: ::c_int = 0x00000010;
pub const RSS_TYPE_TCP_IPV6_EX: ::c_int = 0x00000020;
pub const RSS_TYPE_UDP_IPV4: ::c_int = 0x00000040;
pub const RSS_TYPE_UDP_IPV6: ::c_int = 0x00000080;
pub const RSS_TYPE_UDP_IPV6_EX: ::c_int = 0x00000100;
pub const RSS_KEYLEN: ::c_int = 128;
pub const IFNET_PCP_NONE: ::c_int = 0xff;
pub const IFDR_MSG_SIZE: ::c_int = 64;
pub const IFDR_REASON_MSG: ::c_int = 1;
pub const IFDR_REASON_VENDOR: ::c_int = 2;
// sys/net/if_mib.h
/// non-interface-specific
pub const IFMIB_SYSTEM: ::c_int = 1;
/// per-interface data table
pub const IFMIB_IFDATA: ::c_int = 2;
/// generic stats for all kinds of ifaces
pub const IFDATA_GENERAL: ::c_int = 1;
/// specific to the type of interface
pub const IFDATA_LINKSPECIFIC: ::c_int = 2;
/// driver name and unit
pub const IFDATA_DRIVERNAME: ::c_int = 3;
/// number of interfaces configured
pub const IFMIB_IFCOUNT: ::c_int = 1;
/// functions not specific to a type of iface
pub const NETLINK_GENERIC: ::c_int = 0;
pub const DOT3COMPLIANCE_STATS: ::c_int = 1;
pub const DOT3COMPLIANCE_COLLS: ::c_int = 2;
pub const dot3ChipSetAMD7990: ::c_int = 1;
pub const dot3ChipSetAMD79900: ::c_int = 2;
pub const dot3ChipSetAMD79C940: ::c_int = 3;
pub const dot3ChipSetIntel82586: ::c_int = 1;
pub const dot3ChipSetIntel82596: ::c_int = 2;
pub const dot3ChipSetIntel82557: ::c_int = 3;
pub const dot3ChipSetNational8390: ::c_int = 1;
pub const dot3ChipSetNationalSonic: ::c_int = 2;
pub const dot3ChipSetFujitsu86950: ::c_int = 1;
pub const dot3ChipSetDigitalDC21040: ::c_int = 1;
pub const dot3ChipSetDigitalDC21140: ::c_int = 2;
pub const dot3ChipSetDigitalDC21041: ::c_int = 3;
pub const dot3ChipSetDigitalDC21140A: ::c_int = 4;
pub const dot3ChipSetDigitalDC21142: ::c_int = 5;
pub const dot3ChipSetWesternDigital83C690: ::c_int = 1;
pub const dot3ChipSetWesternDigital83C790: ::c_int = 2;
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// IP6 hop-by-hop options
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// gateway^2 (deprecated)
pub const IPPROTO_GGP: ::c_int = 3;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// Stream protocol II.
pub const IPPROTO_ST: ::c_int = 7;
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// private interior gateway
pub const IPPROTO_PIGP: ::c_int = 9;
/// BBN RCC Monitoring
pub const IPPROTO_RCCMON: ::c_int = 10;
/// network voice protocol
pub const IPPROTO_NVPII: ::c_int = 11;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
/// Argus
pub const IPPROTO_ARGUS: ::c_int = 13;
/// EMCON
pub const IPPROTO_EMCON: ::c_int = 14;
/// Cross Net Debugger
pub const IPPROTO_XNET: ::c_int = 15;
/// Chaos
pub const IPPROTO_CHAOS: ::c_int = 16;
// IPPROTO_UDP defined in src/unix/mod.rs
/// Multiplexing
pub const IPPROTO_MUX: ::c_int = 18;
/// DCN Measurement Subsystems
pub const IPPROTO_MEAS: ::c_int = 19;
/// Host Monitoring
pub const IPPROTO_HMP: ::c_int = 20;
/// Packet Radio Measurement
pub const IPPROTO_PRM: ::c_int = 21;
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// Trunk-1
pub const IPPROTO_TRUNK1: ::c_int = 23;
/// Trunk-2
pub const IPPROTO_TRUNK2: ::c_int = 24;
/// Leaf-1
pub const IPPROTO_LEAF1: ::c_int = 25;
/// Leaf-2
pub const IPPROTO_LEAF2: ::c_int = 26;
/// Reliable Data
pub const IPPROTO_RDP: ::c_int = 27;
/// Reliable Transaction
pub const IPPROTO_IRTP: ::c_int = 28;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// Bulk Data Transfer
pub const IPPROTO_BLT: ::c_int = 30;
/// Network Services
pub const IPPROTO_NSP: ::c_int = 31;
/// Merit Internodal
pub const IPPROTO_INP: ::c_int = 32;
#[doc(hidden)]
#[deprecated(
since = "0.2.72",
note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
)]
pub const IPPROTO_SEP: ::c_int = 33;
/// Datagram Congestion Control Protocol
pub const IPPROTO_DCCP: ::c_int = 33;
/// Third Party Connect
pub const IPPROTO_3PC: ::c_int = 34;
/// InterDomain Policy Routing
pub const IPPROTO_IDPR: ::c_int = 35;
/// XTP
pub const IPPROTO_XTP: ::c_int = 36;
/// Datagram Delivery
pub const IPPROTO_DDP: ::c_int = 37;
/// Control Message Transport
pub const IPPROTO_CMTP: ::c_int = 38;
/// TP++ Transport
pub const IPPROTO_TPXX: ::c_int = 39;
/// IL transport protocol
pub const IPPROTO_IL: ::c_int = 40;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// Source Demand Routing
pub const IPPROTO_SDRP: ::c_int = 42;
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// InterDomain Routing
pub const IPPROTO_IDRP: ::c_int = 45;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// Mobile Host Routing
pub const IPPROTO_MHRP: ::c_int = 48;
/// BHA
pub const IPPROTO_BHA: ::c_int = 49;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
/// Integ. Net Layer Security
pub const IPPROTO_INLSP: ::c_int = 52;
/// IP with encryption
pub const IPPROTO_SWIPE: ::c_int = 53;
/// Next Hop Resolution
pub const IPPROTO_NHRP: ::c_int = 54;
/// IP Mobility
pub const IPPROTO_MOBILE: ::c_int = 55;
/// Transport Layer Security
pub const IPPROTO_TLSP: ::c_int = 56;
/// SKIP
pub const IPPROTO_SKIP: ::c_int = 57;
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
/// any host internal protocol
pub const IPPROTO_AHIP: ::c_int = 61;
/// CFTP
pub const IPPROTO_CFTP: ::c_int = 62;
/// "hello" routing protocol
pub const IPPROTO_HELLO: ::c_int = 63;
/// SATNET/Backroom EXPAK
pub const IPPROTO_SATEXPAK: ::c_int = 64;
/// Kryptolan
pub const IPPROTO_KRYPTOLAN: ::c_int = 65;
/// Remote Virtual Disk
pub const IPPROTO_RVD: ::c_int = 66;
/// Pluribus Packet Core
pub const IPPROTO_IPPC: ::c_int = 67;
/// Any distributed FS
pub const IPPROTO_ADFS: ::c_int = 68;
/// Satnet Monitoring
pub const IPPROTO_SATMON: ::c_int = 69;
/// VISA Protocol
pub const IPPROTO_VISA: ::c_int = 70;
/// Packet Core Utility
pub const IPPROTO_IPCV: ::c_int = 71;
/// Comp. Prot. Net. Executive
pub const IPPROTO_CPNX: ::c_int = 72;
/// Comp. Prot. HeartBeat
pub const IPPROTO_CPHB: ::c_int = 73;
/// Wang Span Network
pub const IPPROTO_WSN: ::c_int = 74;
/// Packet Video Protocol
pub const IPPROTO_PVP: ::c_int = 75;
/// BackRoom SATNET Monitoring
pub const IPPROTO_BRSATMON: ::c_int = 76;
/// Sun net disk proto (temp.)
pub const IPPROTO_ND: ::c_int = 77;
/// WIDEBAND Monitoring
pub const IPPROTO_WBMON: ::c_int = 78;
/// WIDEBAND EXPAK
pub const IPPROTO_WBEXPAK: ::c_int = 79;
/// ISO cnlp
pub const IPPROTO_EON: ::c_int = 80;
/// VMTP
pub const IPPROTO_VMTP: ::c_int = 81;
/// Secure VMTP
pub const IPPROTO_SVMTP: ::c_int = 82;
/// Banyon VINES
pub const IPPROTO_VINES: ::c_int = 83;
/// TTP
pub const IPPROTO_TTP: ::c_int = 84;
/// NSFNET-IGP
pub const IPPROTO_IGP: ::c_int = 85;
/// dissimilar gateway prot.
pub const IPPROTO_DGP: ::c_int = 86;
/// TCF
pub const IPPROTO_TCF: ::c_int = 87;
/// Cisco/GXS IGRP
pub const IPPROTO_IGRP: ::c_int = 88;
/// OSPFIGP
pub const IPPROTO_OSPFIGP: ::c_int = 89;
/// Strite RPC protocol
pub const IPPROTO_SRPC: ::c_int = 90;
/// Locus Address Resoloution
pub const IPPROTO_LARP: ::c_int = 91;
/// Multicast Transport
pub const IPPROTO_MTP: ::c_int = 92;
/// AX.25 Frames
pub const IPPROTO_AX25: ::c_int = 93;
/// IP encapsulated in IP
pub const IPPROTO_IPEIP: ::c_int = 94;
/// Mobile Int.ing control
pub const IPPROTO_MICP: ::c_int = 95;
/// Semaphore Comm. security
pub const IPPROTO_SCCSP: ::c_int = 96;
/// Ethernet IP encapsulation
pub const IPPROTO_ETHERIP: ::c_int = 97;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// any private encr. scheme
pub const IPPROTO_APES: ::c_int = 99;
/// GMTP
pub const IPPROTO_GMTP: ::c_int = 100;
/// payload compression (IPComp)
pub const IPPROTO_IPCOMP: ::c_int = 108;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
/// IPv6 Mobility Header
pub const IPPROTO_MH: ::c_int = 135;
/// UDP-Lite
pub const IPPROTO_UDPLITE: ::c_int = 136;
/// IP6 Host Identity Protocol
pub const IPPROTO_HIP: ::c_int = 139;
/// IP6 Shim6 Protocol
pub const IPPROTO_SHIM6: ::c_int = 140;
/* 101-254: Partly Unassigned */
/// Protocol Independent Mcast
pub const IPPROTO_PIM: ::c_int = 103;
/// CARP
pub const IPPROTO_CARP: ::c_int = 112;
/// PGM
pub const IPPROTO_PGM: ::c_int = 113;
/// MPLS-in-IP
pub const IPPROTO_MPLS: ::c_int = 137;
/// PFSYNC
pub const IPPROTO_PFSYNC: ::c_int = 240;
/* 255: Reserved */
/* BSD Private, local use, namespace incursion, no longer used */
/// OLD divert pseudo-proto
pub const IPPROTO_OLD_DIVERT: ::c_int = 254;
pub const IPPROTO_MAX: ::c_int = 256;
/// last return value of *_input(), meaning "all job for this pkt is done".
pub const IPPROTO_DONE: ::c_int = 257;
/* Only used internally, so can be outside the range of valid IP protocols. */
/// divert pseudo-protocol
pub const IPPROTO_DIVERT: ::c_int = 258;
/// SeND pseudo-protocol
pub const IPPROTO_SEND: ::c_int = 259;
// sys/netinet/TCP.h
pub const TCP_MD5SIG: ::c_int = 16;
pub const TCP_INFO: ::c_int = 32;
pub const TCP_CONGESTION: ::c_int = 64;
pub const TCP_CCALGOOPT: ::c_int = 65;
pub const TCP_MAXUNACKTIME: ::c_int = 68;
pub const TCP_MAXPEAKRATE: ::c_int = 69;
pub const TCP_IDLE_REDUCE: ::c_int = 70;
pub const TCP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 71;
pub const TCP_DELACK: ::c_int = 72;
pub const TCP_FIN_IS_RST: ::c_int = 73;
pub const TCP_LOG_LIMIT: ::c_int = 74;
pub const TCP_SHARED_CWND_ALLOWED: ::c_int = 75;
pub const TCP_PROC_ACCOUNTING: ::c_int = 76;
pub const TCP_USE_CMP_ACKS: ::c_int = 77;
pub const TCP_PERF_INFO: ::c_int = 78;
pub const TCP_LRD: ::c_int = 79;
pub const TCP_KEEPINIT: ::c_int = 128;
pub const TCP_FASTOPEN: ::c_int = 1025;
pub const TCP_PCAP_OUT: ::c_int = 2048;
pub const TCP_PCAP_IN: ::c_int = 4096;
pub const TCP_FASTOPEN_PSK_LEN: ::c_int = 16;
pub const TCP_FUNCTION_NAME_LEN_MAX: ::c_int = 32;
pub const IP_BINDANY: ::c_int = 24;
pub const IP_BINDMULTI: ::c_int = 25;
pub const IP_RSS_LISTEN_BUCKET: ::c_int = 26;
pub const IP_ORIGDSTADDR: ::c_int = 27;
pub const IP_RECVORIGDSTADDR: ::c_int = IP_ORIGDSTADDR;
pub const IP_DONTFRAG: ::c_int = 67;
pub const IP_RECVTOS: ::c_int = 68;
pub const IPV6_BINDANY: ::c_int = 64;
pub const IPV6_ORIGDSTADDR: ::c_int = 72;
pub const IPV6_RECVORIGDSTADDR: ::c_int = IPV6_ORIGDSTADDR;
pub const PF_SLOW: ::c_int = AF_SLOW;
pub const PF_SCLUSTER: ::c_int = AF_SCLUSTER;
pub const PF_ARP: ::c_int = AF_ARP;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const PF_IEEE80211: ::c_int = AF_IEEE80211;
pub const PF_INET_SDP: ::c_int = AF_INET_SDP;
pub const PF_INET6_SDP: ::c_int = AF_INET6_SDP;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
pub const NET_RT_IFLIST: ::c_int = 3;
pub const NET_RT_IFMALIST: ::c_int = 4;
pub const NET_RT_IFLISTL: ::c_int = 5;
// System V IPC
pub const IPC_INFO: ::c_int = 3;
pub const MSG_NOERROR: ::c_int = 0o10000;
pub const SHM_LOCK: ::c_int = 11;
pub const SHM_UNLOCK: ::c_int = 12;
pub const SHM_STAT: ::c_int = 13;
pub const SHM_INFO: ::c_int = 14;
pub const SHM_ANON: *mut ::c_char = 1 as *mut ::c_char;
// The *_MAXID constants never should've been used outside of the
// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID,
// they were all removed in svn r262489. They remain here for backwards
// compatibility only, and are scheduled to be removed in libc 1.0.0.
#[doc(hidden)]
#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
pub const CTL_MAXID: ::c_int = 10;
#[doc(hidden)]
#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
pub const KERN_MAXID: ::c_int = 38;
#[doc(hidden)]
#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
pub const HW_MAXID: ::c_int = 13;
#[doc(hidden)]
#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")]
pub const USER_MAXID: ::c_int = 21;
#[doc(hidden)]
#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")]
pub const CTL_P1003_1B_MAXID: ::c_int = 26;
pub const MSG_NOTIFICATION: ::c_int = 0x00002000;
pub const MSG_NBIO: ::c_int = 0x00004000;
pub const MSG_COMPAT: ::c_int = 0x00008000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x00040000;
pub const MSG_NOSIGNAL: ::c_int = 0x20000;
pub const MSG_WAITFORONE: ::c_int = 0x00080000;
// utmpx entry types
pub const EMPTY: ::c_short = 0;
pub const BOOT_TIME: ::c_short = 1;
pub const OLD_TIME: ::c_short = 2;
pub const NEW_TIME: ::c_short = 3;
pub const USER_PROCESS: ::c_short = 4;
pub const INIT_PROCESS: ::c_short = 5;
pub const LOGIN_PROCESS: ::c_short = 6;
pub const DEAD_PROCESS: ::c_short = 7;
pub const SHUTDOWN_TIME: ::c_short = 8;
// utmp database types
pub const UTXDB_ACTIVE: ::c_int = 0;
pub const UTXDB_LASTLOGIN: ::c_int = 1;
pub const UTXDB_LOG: ::c_int = 2;
pub const LC_COLLATE_MASK: ::c_int = 1 << 0;
pub const LC_CTYPE_MASK: ::c_int = 1 << 1;
pub const LC_MONETARY_MASK: ::c_int = 1 << 2;
pub const LC_NUMERIC_MASK: ::c_int = 1 << 3;
pub const LC_TIME_MASK: ::c_int = 1 << 4;
pub const LC_MESSAGES_MASK: ::c_int = 1 << 5;
pub const LC_ALL_MASK: ::c_int = LC_COLLATE_MASK
| LC_CTYPE_MASK
| LC_MESSAGES_MASK
| LC_MONETARY_MASK
| LC_NUMERIC_MASK
| LC_TIME_MASK;
pub const WSTOPPED: ::c_int = 2; // same as WUNTRACED
pub const WCONTINUED: ::c_int = 4;
pub const WNOWAIT: ::c_int = 8;
pub const WEXITED: ::c_int = 16;
pub const WTRAPPED: ::c_int = 32;
// FreeBSD defines a great many more of these, we only expose the
// standardized ones.
pub const P_PID: idtype_t = 0;
pub const P_PGID: idtype_t = 2;
pub const P_ALL: idtype_t = 7;
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;
pub const B460800: ::speed_t = 460800;
pub const B921600: ::speed_t = 921600;
pub const AT_FDCWD: ::c_int = -100;
pub const AT_EACCESS: ::c_int = 0x100;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
pub const AT_RESOLVE_BENEATH: ::c_int = 0x2000;
pub const AT_EMPTY_PATH: ::c_int = 0x4000;
pub const AT_NULL: ::c_int = 0;
pub const AT_IGNORE: ::c_int = 1;
pub const AT_EXECFD: ::c_int = 2;
pub const AT_PHDR: ::c_int = 3;
pub const AT_PHENT: ::c_int = 4;
pub const AT_PHNUM: ::c_int = 5;
pub const AT_PAGESZ: ::c_int = 6;
pub const AT_BASE: ::c_int = 7;
pub const AT_FLAGS: ::c_int = 8;
pub const AT_ENTRY: ::c_int = 9;
pub const AT_NOTELF: ::c_int = 10;
pub const AT_UID: ::c_int = 11;
pub const AT_EUID: ::c_int = 12;
pub const AT_GID: ::c_int = 13;
pub const AT_EGID: ::c_int = 14;
pub const AT_EXECPATH: ::c_int = 15;
pub const AT_CANARY: ::c_int = 16;
pub const AT_OSRELDATE: ::c_int = 18;
pub const AT_NCPUS: ::c_int = 19;
pub const AT_PAGESIZES: ::c_int = 20;
pub const AT_TIMEKEEP: ::c_int = 22;
pub const AT_HWCAP: ::c_int = 25;
pub const AT_HWCAP2: ::c_int = 26;
pub const AT_USRSTACKBASE: ::c_int = 35;
pub const AT_USRSTACKLIM: ::c_int = 36;
pub const TABDLY: ::tcflag_t = 0x00000004;
pub const TAB0: ::tcflag_t = 0x00000000;
pub const TAB3: ::tcflag_t = 0x00000004;
pub const _PC_ACL_NFS4: ::c_int = 64;
pub const _SC_CPUSET_SIZE: ::c_int = 122;
pub const _UUID_NODE_LEN: usize = 6;
// Flags which can be passed to pdfork(2)
pub const PD_DAEMON: ::c_int = 0x00000001;
pub const PD_CLOEXEC: ::c_int = 0x00000002;
pub const PD_ALLOWED_AT_FORK: ::c_int = PD_DAEMON | PD_CLOEXEC;
// Values for struct rtprio (type_ field)
pub const RTP_PRIO_REALTIME: ::c_ushort = 2;
pub const RTP_PRIO_NORMAL: ::c_ushort = 3;
pub const RTP_PRIO_IDLE: ::c_ushort = 4;
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
// Flags for chflags(2)
pub const UF_SYSTEM: ::c_ulong = 0x00000080;
pub const UF_SPARSE: ::c_ulong = 0x00000100;
pub const UF_OFFLINE: ::c_ulong = 0x00000200;
pub const UF_REPARSE: ::c_ulong = 0x00000400;
pub const UF_ARCHIVE: ::c_ulong = 0x00000800;
pub const UF_READONLY: ::c_ulong = 0x00001000;
pub const UF_HIDDEN: ::c_ulong = 0x00008000;
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
// fcntl commands
pub const F_ADD_SEALS: ::c_int = 19;
pub const F_GET_SEALS: ::c_int = 20;
pub const F_OGETLK: ::c_int = 7;
pub const F_OSETLK: ::c_int = 8;
pub const F_OSETLKW: ::c_int = 9;
pub const F_RDAHEAD: ::c_int = 16;
pub const F_READAHEAD: ::c_int = 15;
pub const F_SETLK_REMOTE: ::c_int = 14;
pub const F_KINFO: ::c_int = 22;
// for use with F_ADD_SEALS
pub const F_SEAL_GROW: ::c_int = 4;
pub const F_SEAL_SEAL: ::c_int = 1;
pub const F_SEAL_SHRINK: ::c_int = 2;
pub const F_SEAL_WRITE: ::c_int = 8;
// for use with fspacectl
pub const SPACECTL_DEALLOC: ::c_int = 1;
// For getrandom()
pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;
// For realhostname* api
pub const HOSTNAME_FOUND: ::c_int = 0;
pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
// For rfork
pub const RFFDG: ::c_int = 4;
pub const RFPROC: ::c_int = 16;
pub const RFMEM: ::c_int = 32;
pub const RFNOWAIT: ::c_int = 64;
pub const RFCFDG: ::c_int = 4096;
pub const RFTHREAD: ::c_int = 8192;
pub const RFSIGSHARE: ::c_int = 16384;
pub const RFLINUXTHPN: ::c_int = 65536;
pub const RFTSIGZMB: ::c_int = 524288;
pub const RFSPAWN: ::c_int = 2147483648;
// For eventfd
pub const EFD_SEMAPHORE: ::c_int = 0x1;
pub const EFD_NONBLOCK: ::c_int = 0x4;
pub const EFD_CLOEXEC: ::c_int = 0x100000;
pub const MALLOCX_ZERO: ::c_int = 0x40;
/// size of returned wchan message
pub const WMESGLEN: usize = 8;
/// size of returned lock name
pub const LOCKNAMELEN: usize = 8;
/// size of returned thread name
pub const TDNAMLEN: usize = 16;
/// size of returned ki_comm name
pub const COMMLEN: usize = 19;
/// size of returned ki_emul
pub const KI_EMULNAMELEN: usize = 16;
/// number of groups in ki_groups
pub const KI_NGROUPS: usize = 16;
cfg_if! {
if #[cfg(freebsd11)] {
pub const KI_NSPARE_INT: usize = 4;
} else {
pub const KI_NSPARE_INT: usize = 2;
}
}
pub const KI_NSPARE_LONG: usize = 12;
/// Flags for the process credential.
pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001;
/// Steal a bit from ki_cr_flags to indicate that the cred had more than
/// KI_NGROUPS groups.
pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000;
/// controlling tty vnode active
pub const KI_CTTY: usize = 0x00000001;
/// session leader
pub const KI_SLEADER: usize = 0x00000002;
/// proc blocked on lock ki_lockname
pub const KI_LOCKBLOCK: usize = 0x00000004;
/// size of returned ki_login
pub const LOGNAMELEN: usize = 17;
/// size of returned ki_loginclass
pub const LOGINCLASSLEN: usize = 17;
pub const KF_ATTR_VALID: ::c_int = 0x0001;
pub const KF_TYPE_NONE: ::c_int = 0;
pub const KF_TYPE_VNODE: ::c_int = 1;
pub const KF_TYPE_SOCKET: ::c_int = 2;
pub const KF_TYPE_PIPE: ::c_int = 3;
pub const KF_TYPE_FIFO: ::c_int = 4;
pub const KF_TYPE_KQUEUE: ::c_int = 5;
pub const KF_TYPE_MQUEUE: ::c_int = 7;
pub const KF_TYPE_SHM: ::c_int = 8;
pub const KF_TYPE_SEM: ::c_int = 9;
pub const KF_TYPE_PTS: ::c_int = 10;
pub const KF_TYPE_PROCDESC: ::c_int = 11;
pub const KF_TYPE_DEV: ::c_int = 12;
pub const KF_TYPE_UNKNOWN: ::c_int = 255;
pub const KF_VTYPE_VNON: ::c_int = 0;
pub const KF_VTYPE_VREG: ::c_int = 1;
pub const KF_VTYPE_VDIR: ::c_int = 2;
pub const KF_VTYPE_VBLK: ::c_int = 3;
pub const KF_VTYPE_VCHR: ::c_int = 4;
pub const KF_VTYPE_VLNK: ::c_int = 5;
pub const KF_VTYPE_VSOCK: ::c_int = 6;
pub const KF_VTYPE_VFIFO: ::c_int = 7;
pub const KF_VTYPE_VBAD: ::c_int = 8;
pub const KF_VTYPE_UNKNOWN: ::c_int = 255;
/// Current working directory
pub const KF_FD_TYPE_CWD: ::c_int = -1;
/// Root directory
pub const KF_FD_TYPE_ROOT: ::c_int = -2;
/// Jail directory
pub const KF_FD_TYPE_JAIL: ::c_int = -3;
/// Ktrace vnode
pub const KF_FD_TYPE_TRACE: ::c_int = -4;
pub const KF_FD_TYPE_TEXT: ::c_int = -5;
/// Controlling terminal
pub const KF_FD_TYPE_CTTY: ::c_int = -6;
pub const KF_FLAG_READ: ::c_int = 0x00000001;
pub const KF_FLAG_WRITE: ::c_int = 0x00000002;
pub const KF_FLAG_APPEND: ::c_int = 0x00000004;
pub const KF_FLAG_ASYNC: ::c_int = 0x00000008;
pub const KF_FLAG_FSYNC: ::c_int = 0x00000010;
pub const KF_FLAG_NONBLOCK: ::c_int = 0x00000020;
pub const KF_FLAG_DIRECT: ::c_int = 0x00000040;
pub const KF_FLAG_HASLOCK: ::c_int = 0x00000080;
pub const KF_FLAG_SHLOCK: ::c_int = 0x00000100;
pub const KF_FLAG_EXLOCK: ::c_int = 0x00000200;
pub const KF_FLAG_NOFOLLOW: ::c_int = 0x00000400;
pub const KF_FLAG_CREAT: ::c_int = 0x00000800;
pub const KF_FLAG_TRUNC: ::c_int = 0x00001000;
pub const KF_FLAG_EXCL: ::c_int = 0x00002000;
pub const KF_FLAG_EXEC: ::c_int = 0x00004000;
pub const KVME_TYPE_NONE: ::c_int = 0;
pub const KVME_TYPE_DEFAULT: ::c_int = 1;
pub const KVME_TYPE_VNODE: ::c_int = 2;
pub const KVME_TYPE_SWAP: ::c_int = 3;
pub const KVME_TYPE_DEVICE: ::c_int = 4;
pub const KVME_TYPE_PHYS: ::c_int = 5;
pub const KVME_TYPE_DEAD: ::c_int = 6;
pub const KVME_TYPE_SG: ::c_int = 7;
pub const KVME_TYPE_MGTDEVICE: ::c_int = 8;
// Present in `sys/user.h` but is undefined for whatever reason...
// pub const KVME_TYPE_GUARD: ::c_int = 9;
pub const KVME_TYPE_UNKNOWN: ::c_int = 255;
pub const KVME_PROT_READ: ::c_int = 0x00000001;
pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
pub const KVME_FLAG_COW: ::c_int = 0x00000001;
pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x00000004;
pub const KVME_FLAG_SUPER: ::c_int = 0x00000008;
pub const KVME_FLAG_GROWS_UP: ::c_int = 0x00000010;
pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x00000020;
pub const KVME_FLAG_USER_WIRED: ::c_int = 0x00000040;
pub const KKST_MAXLEN: ::c_int = 1024;
/// Stack is valid.
pub const KKST_STATE_STACKOK: ::c_int = 0;
/// Stack swapped out.
pub const KKST_STATE_SWAPPED: ::c_int = 1;
pub const KKST_STATE_RUNNING: ::c_int = 2;
// Constants about priority.
pub const PRI_MIN: ::c_int = 0;
pub const PRI_MAX: ::c_int = 255;
pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_REALTIME: ::c_int = 48;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_KERN: ::c_int = 80;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PVM: ::c_int = PRI_MIN_KERN + 4;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_TIMESHARE: ::c_int = 120;
pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
pub const PRI_MIN_IDLE: ::c_int = 224;
pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
pub const NZERO: ::c_int = 0;
// Resource utilization information.
pub const RUSAGE_THREAD: ::c_int = 1;
cfg_if! {
if #[cfg(any(freebsd11, target_pointer_width = "32"))] {
pub const ARG_MAX: ::c_int = 256 * 1024;
} else {
pub const ARG_MAX: ::c_int = 2 * 256 * 1024;
}
}
pub const CHILD_MAX: ::c_int = 40;
/// max command name remembered
pub const MAXCOMLEN: usize = 19;
/// max interpreter file name length
pub const MAXINTERP: ::c_int = ::PATH_MAX;
/// max login name length (incl. NUL)
pub const MAXLOGNAME: ::c_int = 33;
/// max simultaneous processes
pub const MAXUPRC: ::c_int = CHILD_MAX;
/// max bytes for an exec function
pub const NCARGS: ::c_int = ARG_MAX;
/// /* max number groups
pub const NGROUPS: ::c_int = NGROUPS_MAX + 1;
/// max open files per process
pub const NOFILE: ::c_int = OPEN_MAX;
/// marker for empty group set member
pub const NOGROUP: ::c_int = 65535;
/// max hostname size
pub const MAXHOSTNAMELEN: ::c_int = 256;
/// max bytes in term canon input line
pub const MAX_CANON: ::c_int = 255;
/// max bytes in terminal input
pub const MAX_INPUT: ::c_int = 255;
/// max bytes in a file name
pub const NAME_MAX: ::c_int = 255;
pub const MAXSYMLINKS: ::c_int = 32;
/// max supplemental group id's
pub const NGROUPS_MAX: ::c_int = 1023;
/// max open files per process
pub const OPEN_MAX: ::c_int = 64;
pub const _POSIX_ARG_MAX: ::c_int = 4096;
pub const _POSIX_LINK_MAX: ::c_int = 8;
pub const _POSIX_MAX_CANON: ::c_int = 255;
pub const _POSIX_MAX_INPUT: ::c_int = 255;
pub const _POSIX_NAME_MAX: ::c_int = 14;
pub const _POSIX_PIPE_BUF: ::c_int = 512;
pub const _POSIX_SSIZE_MAX: ::c_int = 32767;
pub const _POSIX_STREAM_MAX: ::c_int = 8;
/// max ibase/obase values in bc(1)
pub const BC_BASE_MAX: ::c_int = 99;
/// max array elements in bc(1)
pub const BC_DIM_MAX: ::c_int = 2048;
/// max scale value in bc(1)
pub const BC_SCALE_MAX: ::c_int = 99;
/// max const string length in bc(1)
pub const BC_STRING_MAX: ::c_int = 1000;
/// max character class name size
pub const CHARCLASS_NAME_MAX: ::c_int = 14;
/// max weights for order keyword
pub const COLL_WEIGHTS_MAX: ::c_int = 10;
/// max expressions nested in expr(1)
pub const EXPR_NEST_MAX: ::c_int = 32;
/// max bytes in an input line
pub const LINE_MAX: ::c_int = 2048;
/// max RE's in interval notation
pub const RE_DUP_MAX: ::c_int = 255;
pub const _POSIX2_BC_BASE_MAX: ::c_int = 99;
pub const _POSIX2_BC_DIM_MAX: ::c_int = 2048;
pub const _POSIX2_BC_SCALE_MAX: ::c_int = 99;
pub const _POSIX2_BC_STRING_MAX: ::c_int = 1000;
pub const _POSIX2_CHARCLASS_NAME_MAX: ::c_int = 14;
pub const _POSIX2_COLL_WEIGHTS_MAX: ::c_int = 2;
pub const _POSIX2_EQUIV_CLASS_MAX: ::c_int = 2;
pub const _POSIX2_EXPR_NEST_MAX: ::c_int = 32;
pub const _POSIX2_LINE_MAX: ::c_int = 2048;
pub const _POSIX2_RE_DUP_MAX: ::c_int = 255;
// sys/proc.h
pub const TDF_BORROWING: ::c_int = 0x00000001;
pub const TDF_INPANIC: ::c_int = 0x00000002;
pub const TDF_INMEM: ::c_int = 0x00000004;
pub const TDF_SINTR: ::c_int = 0x00000008;
pub const TDF_TIMEOUT: ::c_int = 0x00000010;
pub const TDF_IDLETD: ::c_int = 0x00000020;
pub const TDF_CANSWAP: ::c_int = 0x00000040;
pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
pub const TDF_BOUNDARY: ::c_int = 0x00000400;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_ASTPENDING: ::c_int = 0x00000800;
pub const TDF_SBDRY: ::c_int = 0x00002000;
pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
pub const TDF_NOLOAD: ::c_int = 0x00040000;
pub const TDF_SERESTART: ::c_int = 0x00080000;
pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
pub const TDF_SEINTR: ::c_int = 0x00200000;
pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")]
pub const TDF_UNUSED23: ::c_int = 0x00800000;
pub const TDF_SCHED0: ::c_int = 0x01000000;
pub const TDF_SCHED1: ::c_int = 0x02000000;
pub const TDF_SCHED2: ::c_int = 0x04000000;
pub const TDF_SCHED3: ::c_int = 0x08000000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_ALRMPEND: ::c_int = 0x10000000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_PROFPEND: ::c_int = 0x20000000;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const TDF_MACPEND: ::c_int = 0x40000000;
pub const TDB_SUSPEND: ::c_int = 0x00000001;
pub const TDB_XSIG: ::c_int = 0x00000002;
pub const TDB_USERWR: ::c_int = 0x00000004;
pub const TDB_SCE: ::c_int = 0x00000008;
pub const TDB_SCX: ::c_int = 0x00000010;
pub const TDB_EXEC: ::c_int = 0x00000020;
pub const TDB_FORK: ::c_int = 0x00000040;
pub const TDB_STOPATFORK: ::c_int = 0x00000080;
pub const TDB_CHILD: ::c_int = 0x00000100;
pub const TDB_BORN: ::c_int = 0x00000200;
pub const TDB_EXIT: ::c_int = 0x00000400;
pub const TDB_VFORK: ::c_int = 0x00000800;
pub const TDB_FSTP: ::c_int = 0x00001000;
pub const TDB_STEP: ::c_int = 0x00002000;
pub const TDP_OLDMASK: ::c_int = 0x00000001;
pub const TDP_INKTR: ::c_int = 0x00000002;
pub const TDP_INKTRACE: ::c_int = 0x00000004;
pub const TDP_BUFNEED: ::c_int = 0x00000008;
pub const TDP_COWINPROGRESS: ::c_int = 0x00000010;
pub const TDP_ALTSTACK: ::c_int = 0x00000020;
pub const TDP_DEADLKTREAT: ::c_int = 0x00000040;
pub const TDP_NOFAULTING: ::c_int = 0x00000080;
pub const TDP_OWEUPC: ::c_int = 0x00000200;
pub const TDP_ITHREAD: ::c_int = 0x00000400;
pub const TDP_SYNCIO: ::c_int = 0x00000800;
pub const TDP_SCHED1: ::c_int = 0x00001000;
pub const TDP_SCHED2: ::c_int = 0x00002000;
pub const TDP_SCHED3: ::c_int = 0x00004000;
pub const TDP_SCHED4: ::c_int = 0x00008000;
pub const TDP_GEOM: ::c_int = 0x00010000;
pub const TDP_SOFTDEP: ::c_int = 0x00020000;
pub const TDP_NORUNNINGBUF: ::c_int = 0x00040000;
pub const TDP_WAKEUP: ::c_int = 0x00080000;
pub const TDP_INBDFLUSH: ::c_int = 0x00100000;
pub const TDP_KTHREAD: ::c_int = 0x00200000;
pub const TDP_CALLCHAIN: ::c_int = 0x00400000;
pub const TDP_IGNSUSP: ::c_int = 0x00800000;
pub const TDP_AUDITREC: ::c_int = 0x01000000;
pub const TDP_RFPPWAIT: ::c_int = 0x02000000;
pub const TDP_RESETSPUR: ::c_int = 0x04000000;
pub const TDP_NERRNO: ::c_int = 0x08000000;
pub const TDP_EXECVMSPC: ::c_int = 0x40000000;
pub const TDI_SUSPENDED: ::c_int = 0x0001;
pub const TDI_SLEEPING: ::c_int = 0x0002;
pub const TDI_SWAPPED: ::c_int = 0x0004;
pub const TDI_LOCK: ::c_int = 0x0008;
pub const TDI_IWAIT: ::c_int = 0x0010;
pub const P_ADVLOCK: ::c_int = 0x00000001;
pub const P_CONTROLT: ::c_int = 0x00000002;
pub const P_KPROC: ::c_int = 0x00000004;
pub const P_UNUSED3: ::c_int = 0x00000008;
pub const P_PPWAIT: ::c_int = 0x00000010;
pub const P_PROFIL: ::c_int = 0x00000020;
pub const P_STOPPROF: ::c_int = 0x00000040;
pub const P_HADTHREADS: ::c_int = 0x00000080;
pub const P_SUGID: ::c_int = 0x00000100;
pub const P_SYSTEM: ::c_int = 0x00000200;
pub const P_SINGLE_EXIT: ::c_int = 0x00000400;
pub const P_TRACED: ::c_int = 0x00000800;
pub const P_WAITED: ::c_int = 0x00001000;
pub const P_WEXIT: ::c_int = 0x00002000;
pub const P_EXEC: ::c_int = 0x00004000;
pub const P_WKILLED: ::c_int = 0x00008000;
pub const P_CONTINUED: ::c_int = 0x00010000;
pub const P_STOPPED_SIG: ::c_int = 0x00020000;
pub const P_STOPPED_TRACE: ::c_int = 0x00040000;
pub const P_STOPPED_SINGLE: ::c_int = 0x00080000;
pub const P_PROTECTED: ::c_int = 0x00100000;
pub const P_SIGEVENT: ::c_int = 0x00200000;
pub const P_SINGLE_BOUNDARY: ::c_int = 0x00400000;
pub const P_HWPMC: ::c_int = 0x00800000;
pub const P_JAILED: ::c_int = 0x01000000;
pub const P_TOTAL_STOP: ::c_int = 0x02000000;
pub const P_INEXEC: ::c_int = 0x04000000;
pub const P_STATCHILD: ::c_int = 0x08000000;
pub const P_INMEM: ::c_int = 0x10000000;
pub const P_SWAPPINGOUT: ::c_int = 0x20000000;
pub const P_SWAPPINGIN: ::c_int = 0x40000000;
pub const P_PPTRACE: ::c_int = 0x80000000;
pub const P_STOPPED: ::c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE;
pub const P2_INHERIT_PROTECTED: ::c_int = 0x00000001;
pub const P2_NOTRACE: ::c_int = 0x00000002;
pub const P2_NOTRACE_EXEC: ::c_int = 0x00000004;
pub const P2_AST_SU: ::c_int = 0x00000008;
pub const P2_PTRACE_FSTP: ::c_int = 0x00000010;
pub const P2_TRAPCAP: ::c_int = 0x00000020;
pub const P2_STKGAP_DISABLE: ::c_int = 0x00000800;
pub const P2_STKGAP_DISABLE_EXEC: ::c_int = 0x00001000;
pub const P_TREE_ORPHANED: ::c_int = 0x00000001;
pub const P_TREE_FIRST_ORPHAN: ::c_int = 0x00000002;
pub const P_TREE_REAPER: ::c_int = 0x00000004;
pub const SIDL: ::c_char = 1;
pub const SRUN: ::c_char = 2;
pub const SSLEEP: ::c_char = 3;
pub const SSTOP: ::c_char = 4;
pub const SZOMB: ::c_char = 5;
pub const SWAIT: ::c_char = 6;
pub const SLOCK: ::c_char = 7;
pub const P_MAGIC: ::c_int = 0xbeefface;
pub const TDP_SIGFASTBLOCK: ::c_int = 0x00000100;
pub const TDP_UIOHELD: ::c_int = 0x10000000;
pub const TDP_SIGFASTPENDING: ::c_int = 0x80000000;
pub const TDP2_COMPAT32RB: ::c_int = 0x00000002;
pub const P2_PROTMAX_ENABLE: ::c_int = 0x00000200;
pub const P2_PROTMAX_DISABLE: ::c_int = 0x00000400;
pub const TDP2_SBPAGES: ::c_int = 0x00000001;
pub const P2_ASLR_ENABLE: ::c_int = 0x00000040;
pub const P2_ASLR_DISABLE: ::c_int = 0x00000080;
pub const P2_ASLR_IGNSTART: ::c_int = 0x00000100;
pub const P_TREE_GRPEXITED: ::c_int = 0x00000008;
// libprocstat.h
pub const PS_FST_VTYPE_VNON: ::c_int = 1;
pub const PS_FST_VTYPE_VREG: ::c_int = 2;
pub const PS_FST_VTYPE_VDIR: ::c_int = 3;
pub const PS_FST_VTYPE_VBLK: ::c_int = 4;
pub const PS_FST_VTYPE_VCHR: ::c_int = 5;
pub const PS_FST_VTYPE_VLNK: ::c_int = 6;
pub const PS_FST_VTYPE_VSOCK: ::c_int = 7;
pub const PS_FST_VTYPE_VFIFO: ::c_int = 8;
pub const PS_FST_VTYPE_VBAD: ::c_int = 9;
pub const PS_FST_VTYPE_UNKNOWN: ::c_int = 255;
pub const PS_FST_TYPE_VNODE: ::c_int = 1;
pub const PS_FST_TYPE_FIFO: ::c_int = 2;
pub const PS_FST_TYPE_SOCKET: ::c_int = 3;
pub const PS_FST_TYPE_PIPE: ::c_int = 4;
pub const PS_FST_TYPE_PTS: ::c_int = 5;
pub const PS_FST_TYPE_KQUEUE: ::c_int = 6;
pub const PS_FST_TYPE_MQUEUE: ::c_int = 8;
pub const PS_FST_TYPE_SHM: ::c_int = 9;
pub const PS_FST_TYPE_SEM: ::c_int = 10;
pub const PS_FST_TYPE_UNKNOWN: ::c_int = 11;
pub const PS_FST_TYPE_NONE: ::c_int = 12;
pub const PS_FST_TYPE_PROCDESC: ::c_int = 13;
pub const PS_FST_TYPE_DEV: ::c_int = 14;
pub const PS_FST_TYPE_EVENTFD: ::c_int = 15;
pub const PS_FST_UFLAG_RDIR: ::c_int = 0x0001;
pub const PS_FST_UFLAG_CDIR: ::c_int = 0x0002;
pub const PS_FST_UFLAG_JAIL: ::c_int = 0x0004;
pub const PS_FST_UFLAG_TRACE: ::c_int = 0x0008;
pub const PS_FST_UFLAG_TEXT: ::c_int = 0x0010;
pub const PS_FST_UFLAG_MMAP: ::c_int = 0x0020;
pub const PS_FST_UFLAG_CTTY: ::c_int = 0x0040;
pub const PS_FST_FFLAG_READ: ::c_int = 0x0001;
pub const PS_FST_FFLAG_WRITE: ::c_int = 0x0002;
pub const PS_FST_FFLAG_NONBLOCK: ::c_int = 0x0004;
pub const PS_FST_FFLAG_APPEND: ::c_int = 0x0008;
pub const PS_FST_FFLAG_SHLOCK: ::c_int = 0x0010;
pub const PS_FST_FFLAG_EXLOCK: ::c_int = 0x0020;
pub const PS_FST_FFLAG_ASYNC: ::c_int = 0x0040;
pub const PS_FST_FFLAG_SYNC: ::c_int = 0x0080;
pub const PS_FST_FFLAG_NOFOLLOW: ::c_int = 0x0100;
pub const PS_FST_FFLAG_CREAT: ::c_int = 0x0200;
pub const PS_FST_FFLAG_TRUNC: ::c_int = 0x0400;
pub const PS_FST_FFLAG_EXCL: ::c_int = 0x0800;
pub const PS_FST_FFLAG_DIRECT: ::c_int = 0x1000;
pub const PS_FST_FFLAG_EXEC: ::c_int = 0x2000;
pub const PS_FST_FFLAG_HASLOCK: ::c_int = 0x4000;
// sys/mount.h
/// File identifier.
/// These are unique per filesystem on a single machine.
///
/// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid
/// undefined behavior accessing unaligned fields within an embedded struct.
pub const MAXFIDSZ: ::c_int = 16;
/// Length of type name including null.
pub const MFSNAMELEN: ::c_int = 16;
cfg_if! {
if #[cfg(any(freebsd10, freebsd11))] {
/// Size of on/from name bufs.
pub const MNAMELEN: ::c_int = 88;
} else {
/// Size of on/from name bufs.
pub const MNAMELEN: ::c_int = 1024;
}
}
/// Using journaled soft updates.
pub const MNT_SUJ: u64 = 0x100000000;
/// Mounted by automountd(8).
pub const MNT_AUTOMOUNTED: u64 = 0x200000000;
/// Filesys metadata untrusted.
pub const MNT_UNTRUSTED: u64 = 0x800000000;
/// Require TLS.
pub const MNT_EXTLS: u64 = 0x4000000000;
/// Require TLS with client cert.
pub const MNT_EXTLSCERT: u64 = 0x8000000000;
/// Require TLS with user cert.
pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000;
/// Filesystem is stored locally.
pub const MNT_LOCAL: u64 = 0x000001000;
/// Quotas are enabled on fs.
pub const MNT_QUOTA: u64 = 0x000002000;
/// Identifies the root fs.
pub const MNT_ROOTFS: u64 = 0x000004000;
/// Mounted by a user.
pub const MNT_USER: u64 = 0x000008000;
/// Do not show entry in df.
pub const MNT_IGNORE: u64 = 0x000800000;
/// Filesystem is verified.
pub const MNT_VERIFIED: u64 = 0x400000000;
/// Do not cover a mount point.
pub const MNT_NOCOVER: u64 = 0x001000000000;
/// Only mount on empty dir.
pub const MNT_EMPTYDIR: u64 = 0x002000000000;
/// Recursively unmount uppers.
pub const MNT_RECURSE: u64 = 0x100000000000;
/// Unmount in async context.
pub const MNT_DEFERRED: u64 = 0x200000000000;
/// Get configured filesystems.
pub const VFS_VFSCONF: ::c_int = 0;
/// Generic filesystem information.
pub const VFS_GENERIC: ::c_int = 0;
/// int: highest defined filesystem type.
pub const VFS_MAXTYPENUM: ::c_int = 1;
/// struct: vfsconf for filesystem given as next argument.
pub const VFS_CONF: ::c_int = 2;
/// Synchronously wait for I/O to complete.
pub const MNT_WAIT: ::c_int = 1;
/// Start all I/O, but do not wait for it.
pub const MNT_NOWAIT: ::c_int = 2;
/// Push data not written by filesystem syncer.
pub const MNT_LAZY: ::c_int = 3;
/// Suspend file system after sync.
pub const MNT_SUSPEND: ::c_int = 4;
pub const MAXSECFLAVORS: ::c_int = 5;
/// Statically compiled into kernel.
pub const VFCF_STATIC: ::c_int = 0x00010000;
/// May get data over the network.
pub const VFCF_NETWORK: ::c_int = 0x00020000;
/// Writes are not implemented.
pub const VFCF_READONLY: ::c_int = 0x00040000;
/// Data does not represent real files.
pub const VFCF_SYNTHETIC: ::c_int = 0x00080000;
/// Aliases some other mounted FS.
pub const VFCF_LOOPBACK: ::c_int = 0x00100000;
/// Stores file names as Unicode.
pub const VFCF_UNICODE: ::c_int = 0x00200000;
/// Can be mounted from within a jail.
pub const VFCF_JAIL: ::c_int = 0x00400000;
/// Supports delegated administration.
pub const VFCF_DELEGADMIN: ::c_int = 0x00800000;
/// Stop at Boundary: defer stop requests to kernel->user (AST) transition.
pub const VFCF_SBDRY: ::c_int = 0x01000000;
// time.h
/// not on dst
pub const DST_NONE: ::c_int = 0;
/// USA style dst
pub const DST_USA: ::c_int = 1;
/// Australian style dst
pub const DST_AUST: ::c_int = 2;
/// Western European dst
pub const DST_WET: ::c_int = 3;
/// Middle European dst
pub const DST_MET: ::c_int = 4;
/// Eastern European dst
pub const DST_EET: ::c_int = 5;
/// Canada
pub const DST_CAN: ::c_int = 6;
pub const CPUCLOCK_WHICH_PID: ::c_int = 0;
pub const CPUCLOCK_WHICH_TID: ::c_int = 1;
pub const MFD_CLOEXEC: ::c_uint = 0x00000001;
pub const MFD_ALLOW_SEALING: ::c_uint = 0x00000002;
pub const MFD_HUGETLB: ::c_uint = 0x00000004;
pub const MFD_HUGE_MASK: ::c_uint = 0xFC000000;
pub const MFD_HUGE_64KB: ::c_uint = 16 << 26;
pub const MFD_HUGE_512KB: ::c_uint = 19 << 26;
pub const MFD_HUGE_1MB: ::c_uint = 20 << 26;
pub const MFD_HUGE_2MB: ::c_uint = 21 << 26;
pub const MFD_HUGE_8MB: ::c_uint = 23 << 26;
pub const MFD_HUGE_16MB: ::c_uint = 24 << 26;
pub const MFD_HUGE_32MB: ::c_uint = 25 << 26;
pub const MFD_HUGE_256MB: ::c_uint = 28 << 26;
pub const MFD_HUGE_512MB: ::c_uint = 29 << 26;
pub const MFD_HUGE_1GB: ::c_uint = 30 << 26;
pub const MFD_HUGE_2GB: ::c_uint = 31 << 26;
pub const MFD_HUGE_16GB: ::c_uint = 34 << 26;
pub const SHM_LARGEPAGE_ALLOC_DEFAULT: ::c_int = 0;
pub const SHM_LARGEPAGE_ALLOC_NOWAIT: ::c_int = 1;
pub const SHM_LARGEPAGE_ALLOC_HARD: ::c_int = 2;
pub const SHM_RENAME_NOREPLACE: ::c_int = 1 << 0;
pub const SHM_RENAME_EXCHANGE: ::c_int = 1 << 1;
// sys/umtx.h
pub const UMTX_OP_WAIT: ::c_int = 2;
pub const UMTX_OP_WAKE: ::c_int = 3;
pub const UMTX_OP_MUTEX_TRYLOCK: ::c_int = 4;
pub const UMTX_OP_MUTEX_LOCK: ::c_int = 5;
pub const UMTX_OP_MUTEX_UNLOCK: ::c_int = 6;
pub const UMTX_OP_SET_CEILING: ::c_int = 7;
pub const UMTX_OP_CV_WAIT: ::c_int = 8;
pub const UMTX_OP_CV_SIGNAL: ::c_int = 9;
pub const UMTX_OP_CV_BROADCAST: ::c_int = 10;
pub const UMTX_OP_WAIT_UINT: ::c_int = 11;
pub const UMTX_OP_RW_RDLOCK: ::c_int = 12;
pub const UMTX_OP_RW_WRLOCK: ::c_int = 13;
pub const UMTX_OP_RW_UNLOCK: ::c_int = 14;
pub const UMTX_OP_WAIT_UINT_PRIVATE: ::c_int = 15;
pub const UMTX_OP_WAKE_PRIVATE: ::c_int = 16;
pub const UMTX_OP_MUTEX_WAIT: ::c_int = 17;
pub const UMTX_OP_NWAKE_PRIVATE: ::c_int = 21;
pub const UMTX_OP_MUTEX_WAKE2: ::c_int = 22;
pub const UMTX_OP_SEM2_WAIT: ::c_int = 23;
pub const UMTX_OP_SEM2_WAKE: ::c_int = 24;
pub const UMTX_OP_SHM: ::c_int = 25;
pub const UMTX_OP_ROBUST_LISTS: ::c_int = 26;
pub const UMTX_ABSTIME: u32 = 1;
pub const CPU_LEVEL_ROOT: ::c_int = 1;
pub const CPU_LEVEL_CPUSET: ::c_int = 2;
pub const CPU_LEVEL_WHICH: ::c_int = 3;
pub const CPU_WHICH_TID: ::c_int = 1;
pub const CPU_WHICH_PID: ::c_int = 2;
pub const CPU_WHICH_CPUSET: ::c_int = 3;
pub const CPU_WHICH_IRQ: ::c_int = 4;
pub const CPU_WHICH_JAIL: ::c_int = 5;
// sys/signal.h
pub const SIGTHR: ::c_int = 32;
pub const SIGLWP: ::c_int = SIGTHR;
pub const SIGLIBRT: ::c_int = 33;
// netinet/sctp.h
pub const SCTP_FUTURE_ASSOC: ::c_int = 0;
pub const SCTP_CURRENT_ASSOC: ::c_int = 1;
pub const SCTP_ALL_ASSOC: ::c_int = 2;
pub const SCTP_NO_NEXT_MSG: ::c_int = 0x0000;
pub const SCTP_NEXT_MSG_AVAIL: ::c_int = 0x0001;
pub const SCTP_NEXT_MSG_ISCOMPLETE: ::c_int = 0x0002;
pub const SCTP_NEXT_MSG_IS_UNORDERED: ::c_int = 0x0004;
pub const SCTP_NEXT_MSG_IS_NOTIFICATION: ::c_int = 0x0008;
pub const SCTP_RECVV_NOINFO: ::c_int = 0;
pub const SCTP_RECVV_RCVINFO: ::c_int = 1;
pub const SCTP_RECVV_NXTINFO: ::c_int = 2;
pub const SCTP_RECVV_RN: ::c_int = 3;
pub const SCTP_SENDV_NOINFO: ::c_int = 0;
pub const SCTP_SENDV_SNDINFO: ::c_int = 1;
pub const SCTP_SENDV_PRINFO: ::c_int = 2;
pub const SCTP_SENDV_AUTHINFO: ::c_int = 3;
pub const SCTP_SENDV_SPA: ::c_int = 4;
pub const SCTP_SEND_SNDINFO_VALID: ::c_int = 0x00000001;
pub const SCTP_SEND_PRINFO_VALID: ::c_int = 0x00000002;
pub const SCTP_SEND_AUTHINFO_VALID: ::c_int = 0x00000004;
pub const SCTP_NOTIFICATION: ::c_int = 0x0010;
pub const SCTP_COMPLETE: ::c_int = 0x0020;
pub const SCTP_EOF: ::c_int = 0x0100;
pub const SCTP_ABORT: ::c_int = 0x0200;
pub const SCTP_UNORDERED: ::c_int = 0x0400;
pub const SCTP_ADDR_OVER: ::c_int = 0x0800;
pub const SCTP_SENDALL: ::c_int = 0x1000;
pub const SCTP_EOR: ::c_int = 0x2000;
pub const SCTP_SACK_IMMEDIATELY: ::c_int = 0x4000;
pub const SCTP_PR_SCTP_NONE: ::c_int = 0x0000;
pub const SCTP_PR_SCTP_TTL: ::c_int = 0x0001;
pub const SCTP_PR_SCTP_PRIO: ::c_int = 0x0002;
pub const SCTP_PR_SCTP_BUF: ::c_int = SCTP_PR_SCTP_PRIO;
pub const SCTP_PR_SCTP_RTX: ::c_int = 0x0003;
pub const SCTP_PR_SCTP_MAX: ::c_int = SCTP_PR_SCTP_RTX;
pub const SCTP_PR_SCTP_ALL: ::c_int = 0x000f;
pub const SCTP_INIT: ::c_int = 0x0001;
pub const SCTP_SNDRCV: ::c_int = 0x0002;
pub const SCTP_EXTRCV: ::c_int = 0x0003;
pub const SCTP_SNDINFO: ::c_int = 0x0004;
pub const SCTP_RCVINFO: ::c_int = 0x0005;
pub const SCTP_NXTINFO: ::c_int = 0x0006;
pub const SCTP_PRINFO: ::c_int = 0x0007;
pub const SCTP_AUTHINFO: ::c_int = 0x0008;
pub const SCTP_DSTADDRV4: ::c_int = 0x0009;
pub const SCTP_DSTADDRV6: ::c_int = 0x000a;
pub const SCTP_RTOINFO: ::c_int = 0x00000001;
pub const SCTP_ASSOCINFO: ::c_int = 0x00000002;
pub const SCTP_INITMSG: ::c_int = 0x00000003;
pub const SCTP_NODELAY: ::c_int = 0x00000004;
pub const SCTP_AUTOCLOSE: ::c_int = 0x00000005;
pub const SCTP_SET_PEER_PRIMARY_ADDR: ::c_int = 0x00000006;
pub const SCTP_PRIMARY_ADDR: ::c_int = 0x00000007;
pub const SCTP_ADAPTATION_LAYER: ::c_int = 0x00000008;
pub const SCTP_ADAPTION_LAYER: ::c_int = 0x00000008;
pub const SCTP_DISABLE_FRAGMENTS: ::c_int = 0x00000009;
pub const SCTP_PEER_ADDR_PARAMS: ::c_int = 0x0000000a;
pub const SCTP_DEFAULT_SEND_PARAM: ::c_int = 0x0000000b;
pub const SCTP_EVENTS: ::c_int = 0x0000000c;
pub const SCTP_I_WANT_MAPPED_V4_ADDR: ::c_int = 0x0000000d;
pub const SCTP_MAXSEG: ::c_int = 0x0000000e;
pub const SCTP_DELAYED_SACK: ::c_int = 0x0000000f;
pub const SCTP_FRAGMENT_INTERLEAVE: ::c_int = 0x00000010;
pub const SCTP_PARTIAL_DELIVERY_POINT: ::c_int = 0x00000011;
pub const SCTP_AUTH_CHUNK: ::c_int = 0x00000012;
pub const SCTP_AUTH_KEY: ::c_int = 0x00000013;
pub const SCTP_HMAC_IDENT: ::c_int = 0x00000014;
pub const SCTP_AUTH_ACTIVE_KEY: ::c_int = 0x00000015;
pub const SCTP_AUTH_DELETE_KEY: ::c_int = 0x00000016;
pub const SCTP_USE_EXT_RCVINFO: ::c_int = 0x00000017;
pub const SCTP_AUTO_ASCONF: ::c_int = 0x00000018;
pub const SCTP_MAXBURST: ::c_int = 0x00000019;
pub const SCTP_MAX_BURST: ::c_int = 0x00000019;
pub const SCTP_CONTEXT: ::c_int = 0x0000001a;
pub const SCTP_EXPLICIT_EOR: ::c_int = 0x00000001b;
pub const SCTP_REUSE_PORT: ::c_int = 0x00000001c;
pub const SCTP_AUTH_DEACTIVATE_KEY: ::c_int = 0x00000001d;
pub const SCTP_EVENT: ::c_int = 0x0000001e;
pub const SCTP_RECVRCVINFO: ::c_int = 0x0000001f;
pub const SCTP_RECVNXTINFO: ::c_int = 0x00000020;
pub const SCTP_DEFAULT_SNDINFO: ::c_int = 0x00000021;
pub const SCTP_DEFAULT_PRINFO: ::c_int = 0x00000022;
pub const SCTP_PEER_ADDR_THLDS: ::c_int = 0x00000023;
pub const SCTP_REMOTE_UDP_ENCAPS_PORT: ::c_int = 0x00000024;
pub const SCTP_ECN_SUPPORTED: ::c_int = 0x00000025;
pub const SCTP_AUTH_SUPPORTED: ::c_int = 0x00000027;
pub const SCTP_ASCONF_SUPPORTED: ::c_int = 0x00000028;
pub const SCTP_RECONFIG_SUPPORTED: ::c_int = 0x00000029;
pub const SCTP_NRSACK_SUPPORTED: ::c_int = 0x00000030;
pub const SCTP_PKTDROP_SUPPORTED: ::c_int = 0x00000031;
pub const SCTP_MAX_CWND: ::c_int = 0x00000032;
pub const SCTP_STATUS: ::c_int = 0x00000100;
pub const SCTP_GET_PEER_ADDR_INFO: ::c_int = 0x00000101;
pub const SCTP_PEER_AUTH_CHUNKS: ::c_int = 0x00000102;
pub const SCTP_LOCAL_AUTH_CHUNKS: ::c_int = 0x00000103;
pub const SCTP_GET_ASSOC_NUMBER: ::c_int = 0x00000104;
pub const SCTP_GET_ASSOC_ID_LIST: ::c_int = 0x00000105;
pub const SCTP_TIMEOUTS: ::c_int = 0x00000106;
pub const SCTP_PR_STREAM_STATUS: ::c_int = 0x00000107;
pub const SCTP_PR_ASSOC_STATUS: ::c_int = 0x00000108;
pub const SCTP_COMM_UP: ::c_int = 0x0001;
pub const SCTP_COMM_LOST: ::c_int = 0x0002;
pub const SCTP_RESTART: ::c_int = 0x0003;
pub const SCTP_SHUTDOWN_COMP: ::c_int = 0x0004;
pub const SCTP_CANT_STR_ASSOC: ::c_int = 0x0005;
pub const SCTP_ASSOC_SUPPORTS_PR: ::c_int = 0x01;
pub const SCTP_ASSOC_SUPPORTS_AUTH: ::c_int = 0x02;
pub const SCTP_ASSOC_SUPPORTS_ASCONF: ::c_int = 0x03;
pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: ::c_int = 0x04;
pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: ::c_int = 0x05;
pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: ::c_int = 0x06;
pub const SCTP_ASSOC_SUPPORTS_MAX: ::c_int = 0x06;
pub const SCTP_ADDR_AVAILABLE: ::c_int = 0x0001;
pub const SCTP_ADDR_UNREACHABLE: ::c_int = 0x0002;
pub const SCTP_ADDR_REMOVED: ::c_int = 0x0003;
pub const SCTP_ADDR_ADDED: ::c_int = 0x0004;
pub const SCTP_ADDR_MADE_PRIM: ::c_int = 0x0005;
pub const SCTP_ADDR_CONFIRMED: ::c_int = 0x0006;
pub const SCTP_ACTIVE: ::c_int = 0x0001;
pub const SCTP_INACTIVE: ::c_int = 0x0002;
pub const SCTP_UNCONFIRMED: ::c_int = 0x0200;
pub const SCTP_DATA_UNSENT: ::c_int = 0x0001;
pub const SCTP_DATA_SENT: ::c_int = 0x0002;
pub const SCTP_PARTIAL_DELIVERY_ABORTED: ::c_int = 0x0001;
pub const SCTP_AUTH_NEW_KEY: ::c_int = 0x0001;
pub const SCTP_AUTH_NEWKEY: ::c_int = SCTP_AUTH_NEW_KEY;
pub const SCTP_AUTH_NO_AUTH: ::c_int = 0x0002;
pub const SCTP_AUTH_FREE_KEY: ::c_int = 0x0003;
pub const SCTP_STREAM_RESET_INCOMING_SSN: ::c_int = 0x0001;
pub const SCTP_STREAM_RESET_OUTGOING_SSN: ::c_int = 0x0002;
pub const SCTP_STREAM_RESET_DENIED: ::c_int = 0x0004;
pub const SCTP_STREAM_RESET_FAILED: ::c_int = 0x0008;
pub const SCTP_ASSOC_RESET_DENIED: ::c_int = 0x0004;
pub const SCTP_ASSOC_RESET_FAILED: ::c_int = 0x0008;
pub const SCTP_STREAM_CHANGE_DENIED: ::c_int = 0x0004;
pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
pub const KENV_DUMP_LOADER: ::c_int = 4;
pub const KENV_DUMP_STATIC: ::c_int = 5;
pub const RB_PAUSE: ::c_int = 0x100000;
pub const RB_REROOT: ::c_int = 0x200000;
pub const RB_POWERCYCLE: ::c_int = 0x400000;
pub const RB_PROBE: ::c_int = 0x10000000;
pub const RB_MULTIPLE: ::c_int = 0x20000000;
// sys/time.h
pub const CLOCK_BOOTTIME: ::clockid_t = ::CLOCK_UPTIME;
pub const CLOCK_REALTIME_COARSE: ::clockid_t = ::CLOCK_REALTIME_FAST;
pub const CLOCK_MONOTONIC_COARSE: ::clockid_t = ::CLOCK_MONOTONIC_FAST;
// sys/timerfd.h
pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
pub const TFD_TIMER_ABSTIME: ::c_int = 0x01;
pub const TFD_TIMER_CANCEL_ON_SET: ::c_int = 0x02;
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
a << 24
}
} else {
pub fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
a << 24
}
}
}
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
}
}
f! {
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}
pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
-> *mut ::cmsghdr
{
if cmsg.is_null() {
return ::CMSG_FIRSTHDR(mhdr);
};
let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+ _ALIGN(::mem::size_of::<::cmsghdr>());
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next > max {
0 as *mut ::cmsghdr
} else {
(cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
as *mut ::cmsghdr
}
}
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
(_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
as ::c_uint
}
pub fn MALLOCX_ALIGN(lg: ::c_uint) -> ::c_int {
ffsl(lg as ::c_long - 1)
}
pub {const} fn MALLOCX_TCACHE(tc: ::c_int) -> ::c_int {
(tc + 2) << 8 as ::c_int
}
pub {const} fn MALLOCX_ARENA(a: ::c_int) -> ::c_int {
(a + 1) << 20 as ::c_int
}
pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
ngrps - 1
} else {
0
};
::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
}
pub fn uname(buf: *mut ::utsname) -> ::c_int {
__xuname(256, buf as *mut ::c_void)
}
pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () {
for slot in cpuset.__bits.iter_mut() {
*slot = 0;
}
}
pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () {
for slot in cpuset.__bits.iter_mut() {
*slot = !0;
}
}
pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () {
let bitset_bits = 8 * ::mem::size_of::<::c_long>();
let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
cpuset.__bits[idx] |= 1 << offset;
()
}
pub fn CPU_CLR(cpu: usize, cpuset: &mut cpuset_t) -> () {
let bitset_bits = 8 * ::mem::size_of::<::c_long>();
let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
cpuset.__bits[idx] &= !(1 << offset);
()
}
pub fn CPU_ISSET(cpu: usize, cpuset: &cpuset_t) -> bool {
let bitset_bits = 8 * ::mem::size_of::<::c_long>();
let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits);
0 != cpuset.__bits[idx] & (1 << offset)
}
pub fn CPU_COUNT(cpuset: &cpuset_t) -> ::c_int {
let mut s: u32 = 0;
let cpuset_size = ::mem::size_of::();
let bitset_size = ::mem::size_of::<::c_long>();
for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() {
s += i.count_ones();
};
s as ::c_int
}
pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
ngrps - 1
} else {
0
};
::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
}
pub fn PROT_MAX(x: ::c_int) -> ::c_int {
x << 16
}
pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
(x >> 16) & (::PROT_READ | ::PROT_WRITE | ::PROT_EXEC)
}
}
safe_f! {
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
(status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13
}
pub {const} fn INVALID_SINFO_FLAG(x: ::c_int) -> bool {
(x) & 0xfffffff0 & !(SCTP_EOF | SCTP_ABORT | SCTP_UNORDERED |
SCTP_ADDR_OVER | SCTP_SENDALL | SCTP_EOR | SCTP_SACK_IMMEDIATELY) != 0
}
pub {const} fn PR_SCTP_POLICY(x: ::c_int) -> ::c_int {
x & 0x0f
}
pub {const} fn PR_SCTP_ENABLED(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE && PR_SCTP_POLICY(x) != SCTP_PR_SCTP_ALL
}
pub {const} fn PR_SCTP_TTL_ENABLED(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL
}
pub {const} fn PR_SCTP_BUF_ENABLED(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF
}
pub {const} fn PR_SCTP_RTX_ENABLED(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX
}
pub {const} fn PR_SCTP_INVALID_POLICY(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX
}
pub {const} fn PR_SCTP_VALID_POLICY(x: ::c_int) -> bool {
PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX
}
}
cfg_if! {
if #[cfg(not(any(freebsd10, freebsd11)))] {
extern "C" {
pub fn fhlink(fhp: *mut fhandle_t, to: *const ::c_char) -> ::c_int;
pub fn fhlinkat(fhp: *mut fhandle_t, tofd: ::c_int, to: *const ::c_char) -> ::c_int;
pub fn fhreadlink(
fhp: *mut fhandle_t,
buf: *mut ::c_char,
bufsize: ::size_t,
) -> ::c_int;
pub fn getfhat(
fd: ::c_int,
path: *mut ::c_char,
fhp: *mut fhandle,
flag: ::c_int,
) -> ::c_int;
}
}
}
extern "C" {
#[cfg_attr(doc, doc(alias = "__errno_location"))]
#[cfg_attr(doc, doc(alias = "errno"))]
pub fn __error() -> *mut ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_readv(aiocbp: *mut ::aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_writev(aiocbp: *mut ::aiocb) -> ::c_int;
pub fn copy_file_range(
infd: ::c_int,
inoffp: *mut ::off_t,
outfd: ::c_int,
outoffp: *mut ::off_t,
len: ::size_t,
flags: ::c_uint,
) -> ::ssize_t;
pub fn devname_r(
dev: ::dev_t,
mode: ::mode_t,
buf: *mut ::c_char,
len: ::c_int,
) -> *mut ::c_char;
pub fn extattr_delete_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_delete_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_delete_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_get_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_get_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_get_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_list_fd(
fd: ::c_int,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_list_file(
path: *const ::c_char,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_list_link(
path: *const ::c_char,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_set_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_set_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_set_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn fspacectl(
fd: ::c_int,
cmd: ::c_int,
rqsr: *const spacectl_range,
flags: ::c_int,
rmsr: *mut spacectl_range,
) -> ::c_int;
pub fn jail(jail: *mut ::jail) -> ::c_int;
pub fn jail_attach(jid: ::c_int) -> ::c_int;
pub fn jail_remove(jid: ::c_int) -> ::c_int;
pub fn jail_get(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn jail_set(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn getutxuser(user: *const ::c_char) -> *mut utmpx;
pub fn setutxdb(_type: ::c_int, file: *const ::c_char) -> ::c_int;
pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut ::timespec) -> ::ssize_t;
pub fn mq_getfd_np(mqd: ::mqd_t) -> ::c_int;
pub fn waitid(
idtype: idtype_t,
id: ::id_t,
infop: *mut ::siginfo_t,
options: ::c_int,
) -> ::c_int;
pub fn ptsname_r(fd: ::c_int, buf: *mut ::c_char, buflen: ::size_t) -> ::c_int;
pub fn ftok(pathname: *const ::c_char, proj_id: ::c_int) -> ::key_t;
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn semget(key: ::key_t, nsems: ::c_int, semflg: ::c_int) -> ::c_int;
pub fn semctl(semid: ::c_int, semnum: ::c_int, cmd: ::c_int, ...) -> ::c_int;
pub fn semop(semid: ::c_int, sops: *mut sembuf, nsops: ::size_t) -> ::c_int;
pub fn msgctl(msqid: ::c_int, cmd: ::c_int, buf: *mut ::msqid_ds) -> ::c_int;
pub fn msgget(key: ::key_t, msgflg: ::c_int) -> ::c_int;
pub fn msgsnd(
msqid: ::c_int,
msgp: *const ::c_void,
msgsz: ::size_t,
msgflg: ::c_int,
) -> ::c_int;
pub fn cfmakesane(termios: *mut ::termios);
pub fn pdfork(fdp: *mut ::c_int, flags: ::c_int) -> ::pid_t;
pub fn pdgetpid(fd: ::c_int, pidp: *mut ::pid_t) -> ::c_int;
pub fn pdkill(fd: ::c_int, signum: ::c_int) -> ::c_int;
pub fn rtprio_thread(function: ::c_int, lwpid: ::lwpid_t, rtp: *mut super::rtprio) -> ::c_int;
pub fn posix_spawn(
pid: *mut ::pid_t,
path: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnp(
pid: *mut ::pid_t,
file: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_getsigdefault(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getflags(
attr: *const posix_spawnattr_t,
flags: *mut ::c_short,
) -> ::c_int;
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
pub fn posix_spawnattr_getpgroup(
attr: *const posix_spawnattr_t,
flags: *mut ::pid_t,
) -> ::c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
pub fn posix_spawnattr_getschedpolicy(
attr: *const posix_spawnattr_t,
flags: *mut ::c_int,
) -> ::c_int;
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
pub fn posix_spawnattr_getschedparam(
attr: *const posix_spawnattr_t,
param: *mut ::sched_param,
) -> ::c_int;
pub fn posix_spawnattr_setschedparam(
attr: *mut posix_spawnattr_t,
param: *const ::sched_param,
) -> ::c_int;
pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_addopen(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
path: *const ::c_char,
oflag: ::c_int,
mode: ::mode_t,
) -> ::c_int;
pub fn posix_spawn_file_actions_addclose(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_adddup2(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
pub fn uuidgen(store: *mut uuid, count: ::c_int) -> ::c_int;
pub fn thr_kill(id: ::c_long, sig: ::c_int) -> ::c_int;
pub fn thr_kill2(pid: ::pid_t, id: ::c_long, sig: ::c_int) -> ::c_int;
pub fn thr_self(tid: *mut ::c_long) -> ::c_int;
pub fn pthread_getthreadid_np() -> ::c_int;
pub fn pthread_getaffinity_np(
td: ::pthread_t,
cpusetsize: ::size_t,
cpusetp: *mut cpuset_t,
) -> ::c_int;
pub fn pthread_setaffinity_np(
td: ::pthread_t,
cpusetsize: ::size_t,
cpusetp: *const cpuset_t,
) -> ::c_int;
// sched.h linux compatibility api
pub fn sched_getaffinity(pid: ::pid_t, cpusetsz: ::size_t, cpuset: *mut ::cpuset_t) -> ::c_int;
pub fn sched_setaffinity(
pid: ::pid_t,
cpusetsz: ::size_t,
cpuset: *const ::cpuset_t,
) -> ::c_int;
pub fn sched_getcpu() -> ::c_int;
pub fn pthread_mutex_consistent(mutex: *mut ::pthread_mutex_t) -> ::c_int;
pub fn pthread_mutexattr_getrobust(
attr: *mut ::pthread_mutexattr_t,
robust: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setrobust(
attr: *mut ::pthread_mutexattr_t,
robust: ::c_int,
) -> ::c_int;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
#[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")]
pub fn statfs(path: *const ::c_char, buf: *mut statfs) -> ::c_int;
#[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")]
pub fn fstatfs(fd: ::c_int, buf: *mut statfs) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
pub fn __xuname(nmln: ::c_int, buf: *mut ::c_void) -> ::c_int;
pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::size_t,
flags: ::c_int,
) -> ::ssize_t;
pub fn recvmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::size_t,
flags: ::c_int,
timeout: *const ::timespec,
) -> ::ssize_t;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
pub fn fhopen(fhp: *const fhandle_t, flags: ::c_int) -> ::c_int;
pub fn fhstat(fhp: *const fhandle, buf: *mut ::stat) -> ::c_int;
pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut ::statfs) -> ::c_int;
pub fn getfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
pub fn lgetfh(path: *const ::c_char, fhp: *mut fhandle_t) -> ::c_int;
pub fn getfsstat(buf: *mut ::statfs, bufsize: ::c_long, mode: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", freebsd11),
link_name = "getmntinfo@FBSD_1.0"
)]
pub fn getmntinfo(mntbufp: *mut *mut ::statfs, mode: ::c_int) -> ::c_int;
pub fn mount(
type_: *const ::c_char,
dir: *const ::c_char,
flags: ::c_int,
data: *mut ::c_void,
) -> ::c_int;
pub fn nmount(iov: *mut ::iovec, niov: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn setproctitle(fmt: *const ::c_char, ...);
pub fn rfork(flags: ::c_int) -> ::c_int;
pub fn cpuset_getaffinity(
level: cpulevel_t,
which: cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut cpuset_t,
) -> ::c_int;
pub fn cpuset_setaffinity(
level: cpulevel_t,
which: cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const cpuset_t,
) -> ::c_int;
pub fn cpuset(setid: *mut ::cpusetid_t) -> ::c_int;
pub fn cpuset_getid(
level: cpulevel_t,
which: cpuwhich_t,
id: ::id_t,
setid: *mut ::cpusetid_t,
) -> ::c_int;
pub fn cpuset_setid(which: cpuwhich_t, id: ::id_t, setid: ::cpusetid_t) -> ::c_int;
pub fn cap_enter() -> ::c_int;
pub fn cap_getmode(modep: *mut ::c_uint) -> ::c_int;
pub fn cap_fcntls_get(fd: ::c_int, fcntlrightsp: *mut u32) -> ::c_int;
pub fn cap_fcntls_limit(fd: ::c_int, fcntlrights: u32) -> ::c_int;
pub fn cap_ioctls_get(fd: ::c_int, cmds: *mut u_long, maxcmds: usize) -> isize;
pub fn cap_ioctls_limit(fd: ::c_int, cmds: *const u_long, ncmds: usize) -> ::c_int;
pub fn __cap_rights_init(version: ::c_int, rights: *mut cap_rights_t, ...)
-> *mut cap_rights_t;
pub fn __cap_rights_get(version: ::c_int, fd: ::c_int, rightsp: *mut cap_rights_t) -> ::c_int;
pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t;
pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool;
pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool;
pub fn cap_rights_limit(fd: ::c_int, rights: *const cap_rights_t) -> ::c_int;
pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t;
pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t)
-> *mut cap_rights_t;
pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool;
pub fn cap_sandboxed() -> bool;
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn ffs(value: ::c_int) -> ::c_int;
pub fn ffsl(value: ::c_long) -> ::c_int;
pub fn ffsll(value: ::c_longlong) -> ::c_int;
pub fn fls(value: ::c_int) -> ::c_int;
pub fn flsl(value: ::c_long) -> ::c_int;
pub fn flsll(value: ::c_longlong) -> ::c_int;
pub fn malloc_stats_print(
write_cb: unsafe extern "C" fn(*mut ::c_void, *const ::c_char),
cbopaque: *mut ::c_void,
opt: *const ::c_char,
);
pub fn mallctl(
name: *const ::c_char,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn mallctlnametomib(
name: *const ::c_char,
mibp: *mut ::size_t,
miplen: *mut ::size_t,
) -> ::c_int;
pub fn mallctlbymib(
mib: *const ::size_t,
mible: ::size_t,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *mut ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn mallocx(size: ::size_t, flags: ::c_int) -> *mut ::c_void;
pub fn rallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int) -> *mut ::c_void;
pub fn xallocx(ptr: *mut ::c_void, size: ::size_t, extra: ::size_t, flags: ::c_int)
-> ::size_t;
pub fn sallocx(ptr: *const ::c_void, flags: ::c_int) -> ::size_t;
pub fn dallocx(ptr: *mut ::c_void, flags: ::c_int);
pub fn sdallocx(ptr: *mut ::c_void, size: ::size_t, flags: ::c_int);
pub fn nallocx(size: ::size_t, flags: ::c_int) -> ::size_t;
pub fn procctl(idtype: ::idtype_t, id: ::id_t, cmd: ::c_int, data: *mut ::c_void) -> ::c_int;
pub fn getpagesize() -> ::c_int;
pub fn getpagesizes(pagesize: *mut ::size_t, nelem: ::c_int) -> ::c_int;
pub fn clock_getcpuclockid2(arg1: ::id_t, arg2: ::c_int, arg3: *mut clockid_t) -> ::c_int;
pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;
pub fn shm_create_largepage(
path: *const ::c_char,
flags: ::c_int,
psind: ::c_int,
alloc_policy: ::c_int,
mode: ::mode_t,
) -> ::c_int;
pub fn shm_rename(
path_from: *const ::c_char,
path_to: *const ::c_char,
flags: ::c_int,
) -> ::c_int;
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
pub fn setaudit(auditinfo: *const auditinfo_t) -> ::c_int;
pub fn eventfd(init: ::c_uint, flags: ::c_int) -> ::c_int;
pub fn eventfd_read(fd: ::c_int, value: *mut eventfd_t) -> ::c_int;
pub fn eventfd_write(fd: ::c_int, value: eventfd_t) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
pub fn setproctitle_fast(fmt: *const ::c_char, ...);
pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn _umtx_op(
obj: *mut ::c_void,
op: ::c_int,
val: ::c_ulong,
uaddr: *mut ::c_void,
uaddr2: *mut ::c_void,
) -> ::c_int;
pub fn sctp_peeloff(s: ::c_int, id: ::sctp_assoc_t) -> ::c_int;
pub fn sctp_bindx(s: ::c_int, addrs: *mut ::sockaddr, num: ::c_int, tpe: ::c_int) -> ::c_int;
pub fn sctp_connectx(
s: ::c_int,
addrs: *const ::sockaddr,
addrcnt: ::c_int,
id: *mut ::sctp_assoc_t,
) -> ::c_int;
pub fn sctp_getaddrlen(family: ::sa_family_t) -> ::c_int;
pub fn sctp_getpaddrs(
s: ::c_int,
asocid: ::sctp_assoc_t,
addrs: *mut *mut ::sockaddr,
) -> ::c_int;
pub fn sctp_freepaddrs(addrs: *mut ::sockaddr);
pub fn sctp_getladdrs(
s: ::c_int,
asocid: ::sctp_assoc_t,
addrs: *mut *mut ::sockaddr,
) -> ::c_int;
pub fn sctp_freeladdrs(addrs: *mut ::sockaddr);
pub fn sctp_opt_info(
s: ::c_int,
id: ::sctp_assoc_t,
opt: ::c_int,
arg: *mut ::c_void,
size: *mut ::socklen_t,
) -> ::c_int;
pub fn sctp_sendv(
sd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
addrs: *mut ::sockaddr,
addrcnt: ::c_int,
info: *mut ::c_void,
infolen: ::socklen_t,
infotype: ::c_uint,
flags: ::c_int,
) -> ::ssize_t;
pub fn sctp_recvv(
sd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int,
from: *mut ::sockaddr,
fromlen: *mut ::socklen_t,
info: *mut ::c_void,
infolen: *mut ::socklen_t,
infotype: *mut ::c_uint,
flags: *mut ::c_int,
) -> ::ssize_t;
pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
pub fn timerfd_settime(
fd: ::c_int,
flags: ::c_int,
new_value: *const itimerspec,
old_value: *mut itimerspec,
) -> ::c_int;
pub fn closefrom(lowfd: ::c_int);
pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
}
#[link(name = "memstat")]
extern "C" {
pub fn memstat_strerror(error: ::c_int) -> *const ::c_char;
pub fn memstat_mtl_alloc() -> *mut memory_type_list;
pub fn memstat_mtl_first(list: *mut memory_type_list) -> *mut memory_type;
pub fn memstat_mtl_next(mtp: *mut memory_type) -> *mut memory_type;
pub fn memstat_mtl_find(
list: *mut memory_type_list,
allocator: ::c_int,
name: *const ::c_char,
) -> *mut memory_type;
pub fn memstat_mtl_free(list: *mut memory_type_list);
pub fn memstat_mtl_geterror(list: *mut memory_type_list) -> ::c_int;
pub fn memstat_get_name(mtp: *const memory_type) -> *const ::c_char;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_dpcpu_setcpu(kd: *mut ::kvm_t, cpu: ::c_uint) -> ::c_int;
pub fn kvm_getargv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
-> *mut *mut ::c_char;
pub fn kvm_getcptime(kd: *mut ::kvm_t, cp_time: *mut ::c_long) -> ::c_int;
pub fn kvm_getenvv(kd: *mut ::kvm_t, p: *const kinfo_proc, nchr: ::c_int)
-> *mut *mut ::c_char;
pub fn kvm_geterr(kd: *mut ::kvm_t) -> *mut ::c_char;
pub fn kvm_getmaxcpu(kd: *mut ::kvm_t) -> ::c_int;
pub fn kvm_getncpus(kd: *mut ::kvm_t) -> ::c_int;
pub fn kvm_getpcpu(kd: *mut ::kvm_t, cpu: ::c_int) -> *mut ::c_void;
pub fn kvm_counter_u64_fetch(kd: *mut ::kvm_t, base: ::c_ulong) -> u64;
pub fn kvm_getswapinfo(
kd: *mut ::kvm_t,
info: *mut kvm_swap,
maxswap: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn kvm_native(kd: *mut ::kvm_t) -> ::c_int;
pub fn kvm_nlist(kd: *mut ::kvm_t, nl: *mut nlist) -> ::c_int;
pub fn kvm_nlist2(kd: *mut ::kvm_t, nl: *mut kvm_nlist) -> ::c_int;
pub fn kvm_read_zpcpu(
kd: *mut ::kvm_t,
base: ::c_ulong,
buf: *mut ::c_void,
size: ::size_t,
cpu: ::c_int,
) -> ::ssize_t;
pub fn kvm_read2(
kd: *mut ::kvm_t,
addr: kvaddr_t,
buf: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
}
#[link(name = "util")]
extern "C" {
pub fn extattr_namespace_to_string(
attrnamespace: ::c_int,
string: *mut *mut ::c_char,
) -> ::c_int;
pub fn extattr_string_to_namespace(
string: *const ::c_char,
attrnamespace: *mut ::c_int,
) -> ::c_int;
pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int;
pub fn realhostname_sa(
host: *mut ::c_char,
hsize: ::size_t,
addr: *mut ::sockaddr,
addrlen: ::c_int,
) -> ::c_int;
pub fn kld_isloaded(name: *const ::c_char) -> ::c_int;
pub fn kld_load(name: *const ::c_char) -> ::c_int;
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::c_int) -> *mut kinfo_vmentry;
pub fn hexdump(ptr: *const ::c_void, length: ::c_int, hdr: *const ::c_char, flags: ::c_int);
pub fn humanize_number(
buf: *mut ::c_char,
len: ::size_t,
number: i64,
suffix: *const ::c_char,
scale: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn flopen(path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
pub fn flopenat(fd: ::c_int, path: *const ::c_char, flags: ::c_int, ...) -> ::c_int;
pub fn getlocalbase() -> *const ::c_char;
pub fn pidfile_open(
path: *const ::c_char,
mode: ::mode_t,
pidptr: *mut ::pid_t,
) -> *mut ::pidfh;
pub fn pidfile_write(path: *mut ::pidfh) -> ::c_int;
pub fn pidfile_close(path: *mut ::pidfh) -> ::c_int;
pub fn pidfile_remove(path: *mut ::pidfh) -> ::c_int;
pub fn pidfile_fileno(path: *const ::pidfh) -> ::c_int;
// FIXME: pidfile_signal in due time (both manpage present and updated image snapshot)
}
#[link(name = "procstat")]
extern "C" {
pub fn procstat_open_sysctl() -> *mut procstat;
pub fn procstat_getfiles(
procstat: *mut procstat,
kp: *mut kinfo_proc,
mmapped: ::c_int,
) -> *mut filestat_list;
pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list);
pub fn procstat_getprocs(
procstat: *mut procstat,
what: ::c_int,
arg: ::c_int,
count: *mut ::c_uint,
) -> *mut kinfo_proc;
pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc);
pub fn procstat_getvmmap(
procstat: *mut procstat,
kp: *mut kinfo_proc,
count: *mut ::c_uint,
) -> *mut kinfo_vmentry;
pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry);
pub fn procstat_close(procstat: *mut procstat);
pub fn procstat_freeargv(procstat: *mut procstat);
pub fn procstat_freeenvv(procstat: *mut procstat);
pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut ::gid_t);
pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo);
pub fn procstat_getargv(
procstat: *mut procstat,
kp: *mut kinfo_proc,
nchr: ::size_t,
) -> *mut *mut ::c_char;
pub fn procstat_getenvv(
procstat: *mut procstat,
kp: *mut kinfo_proc,
nchr: ::size_t,
) -> *mut *mut ::c_char;
pub fn procstat_getgroups(
procstat: *mut procstat,
kp: *mut kinfo_proc,
count: *mut ::c_uint,
) -> *mut ::gid_t;
pub fn procstat_getosrel(
procstat: *mut procstat,
kp: *mut kinfo_proc,
osrelp: *mut ::c_int,
) -> ::c_int;
pub fn procstat_getpathname(
procstat: *mut procstat,
kp: *mut kinfo_proc,
pathname: *mut ::c_char,
maxlen: ::size_t,
) -> ::c_int;
pub fn procstat_getrlimit(
procstat: *mut procstat,
kp: *mut kinfo_proc,
which: ::c_int,
rlimit: *mut ::rlimit,
) -> ::c_int;
pub fn procstat_getumask(
procstat: *mut procstat,
kp: *mut kinfo_proc,
maskp: *mut ::c_ushort,
) -> ::c_int;
pub fn procstat_open_core(filename: *const ::c_char) -> *mut procstat;
pub fn procstat_open_kvm(nlistf: *const ::c_char, memf: *const ::c_char) -> *mut procstat;
pub fn procstat_get_socket_info(
proc_: *mut procstat,
fst: *mut filestat,
sock: *mut sockstat,
errbuf: *mut ::c_char,
) -> ::c_int;
pub fn procstat_get_vnode_info(
proc_: *mut procstat,
fst: *mut filestat,
vn: *mut vnstat,
errbuf: *mut ::c_char,
) -> ::c_int;
pub fn procstat_get_pts_info(
proc_: *mut procstat,
fst: *mut filestat,
pts: *mut ptsstat,
errbuf: *mut ::c_char,
) -> ::c_int;
pub fn procstat_get_shm_info(
proc_: *mut procstat,
fst: *mut filestat,
shm: *mut shmstat,
errbuf: *mut ::c_char,
) -> ::c_int;
}
#[link(name = "rt")]
extern "C" {
pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> ::c_int;
pub fn timer_delete(timerid: timer_t) -> ::c_int;
pub fn timer_getoverrun(timerid: timer_t) -> ::c_int;
pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::c_int;
pub fn timer_settime(
timerid: timer_t,
flags: ::c_int,
value: *const itimerspec,
ovalue: *mut itimerspec,
) -> ::c_int;
}
#[link(name = "devstat")]
extern "C" {
pub fn devstat_getnumdevs(kd: *mut ::kvm_t) -> ::c_int;
pub fn devstat_getgeneration(kd: *mut ::kvm_t) -> ::c_long;
pub fn devstat_getversion(kd: *mut ::kvm_t) -> ::c_int;
pub fn devstat_checkversion(kd: *mut ::kvm_t) -> ::c_int;
pub fn devstat_selectdevs(
dev_select: *mut *mut device_selection,
num_selected: *mut ::c_int,
num_selections: *mut ::c_int,
select_generation: *mut ::c_long,
current_generation: ::c_long,
devices: *mut devstat,
numdevs: ::c_int,
matches: *mut devstat_match,
num_matches: ::c_int,
dev_selections: *mut *mut ::c_char,
num_dev_selections: ::c_int,
select_mode: devstat_select_mode,
maxshowdevs: ::c_int,
perf_select: ::c_int,
) -> ::c_int;
pub fn devstat_buildmatch(
match_str: *mut ::c_char,
matches: *mut *mut devstat_match,
num_matches: *mut ::c_int,
) -> ::c_int;
}
cfg_if! {
if #[cfg(freebsd15)] {
mod freebsd15;
pub use self::freebsd15::*;
} else if #[cfg(freebsd14)] {
mod freebsd14;
pub use self::freebsd14::*;
} else if #[cfg(freebsd13)] {
mod freebsd13;
pub use self::freebsd13::*;
} else if #[cfg(freebsd12)] {
mod freebsd12;
pub use self::freebsd12::*;
} else if #[cfg(any(freebsd10, freebsd11))] {
mod freebsd11;
pub use self::freebsd11::*;
} else {
// Unknown freebsd version
}
}
cfg_if! {
if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "powerpc64")] {
mod powerpc64;
pub use self::powerpc64::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub use self::riscv64::*;
} else {
// Unknown target_arch
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/powerpc.rs 0000644 0000000 0000000 00000002370 10461020230 0021146 0 ustar 0000000 0000000 pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i32;
pub type register_t = i32;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 0000644 0000000 0000000 00000002371 10461020230 0021321 0 ustar 0000000 0000000 pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/riscv64.rs 0000644 0000000 0000000 00000012535 10461020230 0020773 0 ustar 0000000 0000000 pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = ::c_int;
pub type time_t = i64;
pub type suseconds_t = ::c_long;
pub type register_t = i64;
s_no_extra_traits! {
pub struct gpregs {
pub gp_ra: ::register_t,
pub gp_sp: ::register_t,
pub gp_gp: ::register_t,
pub gp_tp: ::register_t,
pub gp_t: [::register_t; 7],
pub gp_s: [::register_t; 12],
pub gp_a: [::register_t; 8],
pub gp_sepc: ::register_t,
pub gp_sstatus: ::register_t,
}
pub struct fpregs {
pub fp_x: [[::register_t; 2]; 32],
pub fp_fcsr: ::register_t,
pub fp_flags: ::c_int,
pub fp_pad: ::c_int,
}
pub struct mcontext_t {
pub mc_gpregs: gpregs,
pub mc_fpregs: fpregs,
pub mc_flags: ::c_int,
pub mc_pad: ::c_int,
pub mc_spare: [u64; 8],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for gpregs {
fn eq(&self, other: &gpregs) -> bool {
self.gp_ra == other.gp_ra &&
self.gp_sp == other.gp_sp &&
self.gp_gp == other.gp_gp &&
self.gp_tp == other.gp_tp &&
self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) &&
self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) &&
self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) &&
self.gp_sepc == other.gp_sepc &&
self.gp_sstatus == other.gp_sstatus
}
}
impl Eq for gpregs {}
impl ::fmt::Debug for gpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("gpregs")
.field("gp_ra", &self.gp_ra)
.field("gp_sp", &self.gp_sp)
.field("gp_gp", &self.gp_gp)
.field("gp_tp", &self.gp_tp)
.field("gp_t", &self.gp_t)
.field("gp_s", &self.gp_s)
.field("gp_a", &self.gp_a)
.field("gp_sepc", &self.gp_sepc)
.field("gp_sstatus", &self.gp_sstatus)
.finish()
}
}
impl ::hash::Hash for gpregs {
fn hash(&self, state: &mut H) {
self.gp_ra.hash(state);
self.gp_sp.hash(state);
self.gp_gp.hash(state);
self.gp_tp.hash(state);
self.gp_t.hash(state);
self.gp_s.hash(state);
self.gp_a.hash(state);
self.gp_sepc.hash(state);
self.gp_sstatus.hash(state);
}
}
impl PartialEq for fpregs {
fn eq(&self, other: &fpregs) -> bool {
self.fp_x == other.fp_x &&
self.fp_fcsr == other.fp_fcsr &&
self.fp_flags == other.fp_flags &&
self.fp_pad == other.fp_pad
}
}
impl Eq for fpregs {}
impl ::fmt::Debug for fpregs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpregs")
.field("fp_x", &self.fp_x)
.field("fp_fcsr", &self.fp_fcsr)
.field("fp_flags", &self.fp_flags)
.field("fp_pad", &self.fp_pad)
.finish()
}
}
impl ::hash::Hash for fpregs {
fn hash(&self, state: &mut H) {
self.fp_x.hash(state);
self.fp_fcsr.hash(state);
self.fp_flags.hash(state);
self.fp_pad.hash(state);
}
}
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_gpregs == other.mc_gpregs &&
self.mc_fpregs == other.mc_fpregs &&
self.mc_flags == other.mc_flags &&
self.mc_pad == other.mc_pad &&
self.mc_spare.iter().zip(other.mc_spare.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_gpregs", &self.mc_gpregs)
.field("mc_fpregs", &self.mc_fpregs)
.field("mc_flags", &self.mc_flags)
.field("mc_pad", &self.mc_pad)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash(&self, state: &mut H) {
self.mc_gpregs.hash(state);
self.mc_fpregs.hash(state);
self.mc_flags.hash(state);
self.mc_pad.hash(state);
self.mc_spare.hash(state);
}
}
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/x86.rs 0000644 0000000 0000000 00000016641 10461020230 0020122 0 ustar 0000000 0000000 pub type c_char = i8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type wchar_t = i32;
pub type time_t = i32;
pub type suseconds_t = i32;
pub type register_t = i32;
s_no_extra_traits! {
pub struct mcontext_t {
pub mc_onstack: register_t,
pub mc_gs: register_t,
pub mc_fs: register_t,
pub mc_es: register_t,
pub mc_ds: register_t,
pub mc_edi: register_t,
pub mc_esi: register_t,
pub mc_ebp: register_t,
pub mc_isp: register_t,
pub mc_ebx: register_t,
pub mc_edx: register_t,
pub mc_ecx: register_t,
pub mc_eax: register_t,
pub mc_trapno: register_t,
pub mc_err: register_t,
pub mc_eip: register_t,
pub mc_cs: register_t,
pub mc_eflags: register_t,
pub mc_esp: register_t,
pub mc_ss: register_t,
pub mc_len: ::c_int,
pub mc_fpformat: ::c_int,
pub mc_ownedfp: ::c_int,
pub mc_flags: register_t,
pub mc_fpstate: [[::c_int; 32]; 4],
pub mc_fsbase: register_t,
pub mc_gsbase: register_t,
pub mc_xfpustate: register_t,
pub mc_xfpustate_len: register_t,
pub mc_spare2: [::c_int; 4],
}
}
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u32,
pub st_lspare: i32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
__unused: [u8; 8],
}
pub struct ucontext_t {
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ::ucontext_t,
pub uc_stack: ::stack_t,
pub uc_flags: ::c_int,
__spare__: [::c_int; 4],
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_onstack == other.mc_onstack &&
self.mc_gs == other.mc_gs &&
self.mc_fs == other.mc_fs &&
self.mc_es == other.mc_es &&
self.mc_ds == other.mc_ds &&
self.mc_edi == other.mc_edi &&
self.mc_esi == other.mc_esi &&
self.mc_ebp == other.mc_ebp &&
self.mc_isp == other.mc_isp &&
self.mc_ebx == other.mc_ebx &&
self.mc_edx == other.mc_edx &&
self.mc_ecx == other.mc_ecx &&
self.mc_eax == other.mc_eax &&
self.mc_trapno == other.mc_trapno &&
self.mc_err == other.mc_err &&
self.mc_eip == other.mc_eip &&
self.mc_cs == other.mc_cs &&
self.mc_eflags == other.mc_eflags &&
self.mc_esp == other.mc_esp &&
self.mc_ss == other.mc_ss &&
self.mc_len == other.mc_len &&
self.mc_fpformat == other.mc_fpformat &&
self.mc_ownedfp == other.mc_ownedfp &&
self.mc_flags == other.mc_flags &&
self.mc_fpstate.iter().zip(other.mc_fpstate.iter()).all(|(a, b)| a == b) &&
self.mc_fsbase == other.mc_fsbase &&
self.mc_gsbase == other.mc_gsbase &&
self.mc_xfpustate == other.mc_xfpustate &&
self.mc_xfpustate_len == other.mc_xfpustate_len &&
self.mc_spare2.iter().zip(other.mc_spare2.iter()).all(|(a, b)| a == b)
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_onstack", &self.mc_onstack)
.field("mc_gs", &self.mc_gs)
.field("mc_fs", &self.mc_fs)
.field("mc_es", &self.mc_es)
.field("mc_ds", &self.mc_ds)
.field("mc_edi", &self.mc_edi)
.field("mc_esi", &self.mc_esi)
.field("mc_ebp", &self.mc_ebp)
.field("mc_isp", &self.mc_isp)
.field("mc_ebx", &self.mc_ebx)
.field("mc_edx", &self.mc_edx)
.field("mc_ecx", &self.mc_ecx)
.field("mc_eax", &self.mc_eax)
.field("mc_trapno", &self.mc_trapno)
.field("mc_err", &self.mc_err)
.field("mc_eip", &self.mc_eip)
.field("mc_cs", &self.mc_cs)
.field("mc_eflags", &self.mc_eflags)
.field("mc_esp", &self.mc_esp)
.field("mc_ss", &self.mc_ss)
.field("mc_len", &self.mc_len)
.field("mc_fpformat", &self.mc_fpformat)
.field("mc_ownedfp", &self.mc_ownedfp)
.field("mc_flags", &self.mc_flags)
.field("mc_fpstate", &self.mc_fpstate)
.field("mc_fsbase", &self.mc_fsbase)
.field("mc_gsbase", &self.mc_gsbase)
.field("mc_xfpustate", &self.mc_xfpustate)
.field("mc_xfpustate_len", &self.mc_xfpustate_len)
.field("mc_spare2", &self.mc_spare2)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash(&self, state: &mut H) {
self.mc_onstack.hash(state);
self.mc_gs.hash(state);
self.mc_fs.hash(state);
self.mc_es.hash(state);
self.mc_ds.hash(state);
self.mc_edi.hash(state);
self.mc_esi.hash(state);
self.mc_ebp.hash(state);
self.mc_isp.hash(state);
self.mc_ebx.hash(state);
self.mc_edx.hash(state);
self.mc_ecx.hash(state);
self.mc_eax.hash(state);
self.mc_trapno.hash(state);
self.mc_err.hash(state);
self.mc_eip.hash(state);
self.mc_cs.hash(state);
self.mc_eflags.hash(state);
self.mc_esp.hash(state);
self.mc_ss.hash(state);
self.mc_len.hash(state);
self.mc_fpformat.hash(state);
self.mc_ownedfp.hash(state);
self.mc_flags.hash(state);
self.mc_fpstate.hash(state);
self.mc_fsbase.hash(state);
self.mc_gsbase.hash(state);
self.mc_xfpustate.hash(state);
self.mc_xfpustate_len.hash(state);
self.mc_spare2.hash(state);
}
}
}
}
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/x86_64/align.rs 0000644 0000000 0000000 00000017175 10461020230 0021530 0 ustar 0000000 0000000 use {c_long, register_t};
s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(16))]
pub struct max_align_t {
priv_: [f64; 4]
}
#[repr(align(16))]
pub struct mcontext_t {
pub mc_onstack: register_t,
pub mc_rdi: register_t,
pub mc_rsi: register_t,
pub mc_rdx: register_t,
pub mc_rcx: register_t,
pub mc_r8: register_t,
pub mc_r9: register_t,
pub mc_rax: register_t,
pub mc_rbx: register_t,
pub mc_rbp: register_t,
pub mc_r10: register_t,
pub mc_r11: register_t,
pub mc_r12: register_t,
pub mc_r13: register_t,
pub mc_r14: register_t,
pub mc_r15: register_t,
pub mc_trapno: u32,
pub mc_fs: u16,
pub mc_gs: u16,
pub mc_addr: register_t,
pub mc_flags: u32,
pub mc_es: u16,
pub mc_ds: u16,
pub mc_err: register_t,
pub mc_rip: register_t,
pub mc_cs: register_t,
pub mc_rflags: register_t,
pub mc_rsp: register_t,
pub mc_ss: register_t,
pub mc_len: c_long,
pub mc_fpformat: c_long,
pub mc_ownedfp: c_long,
pub mc_fpstate: [c_long; 64],
pub mc_fsbase: register_t,
pub mc_gsbase: register_t,
pub mc_xfpustate: register_t,
pub mc_xfpustate_len: register_t,
pub mc_spare: [c_long; 4],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_onstack == other.mc_onstack &&
self.mc_rdi == other.mc_rdi &&
self.mc_rsi == other.mc_rsi &&
self.mc_rdx == other.mc_rdx &&
self.mc_rcx == other.mc_rcx &&
self.mc_r8 == other.mc_r8 &&
self.mc_r9 == other.mc_r9 &&
self.mc_rax == other.mc_rax &&
self.mc_rbx == other.mc_rbx &&
self.mc_rbp == other.mc_rbp &&
self.mc_r10 == other.mc_r10 &&
self.mc_r11 == other.mc_r11 &&
self.mc_r12 == other.mc_r12 &&
self.mc_r13 == other.mc_r13 &&
self.mc_r14 == other.mc_r14 &&
self.mc_r15 == other.mc_r15 &&
self.mc_trapno == other.mc_trapno &&
self.mc_fs == other.mc_fs &&
self.mc_gs == other.mc_gs &&
self.mc_addr == other.mc_addr &&
self.mc_flags == other.mc_flags &&
self.mc_es == other.mc_es &&
self.mc_ds == other.mc_ds &&
self.mc_err == other.mc_err &&
self.mc_rip == other.mc_rip &&
self.mc_cs == other.mc_cs &&
self.mc_rflags == other.mc_rflags &&
self.mc_rsp == other.mc_rsp &&
self.mc_ss == other.mc_ss &&
self.mc_len == other.mc_len &&
self.mc_fpformat == other.mc_fpformat &&
self.mc_ownedfp == other.mc_ownedfp &&
self.mc_fpstate.iter().zip(other.mc_fpstate.iter())
.all(|(a, b)| a == b) &&
self.mc_fsbase == other.mc_fsbase &&
self.mc_gsbase == other.mc_gsbase &&
self.mc_xfpustate == other.mc_xfpustate &&
self.mc_xfpustate_len == other.mc_xfpustate_len &&
self.mc_spare == other.mc_spare
}
}
impl Eq for mcontext_t {}
impl ::fmt::Debug for mcontext_t {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("mcontext_t")
.field("mc_onstack", &self.mc_onstack)
.field("mc_rdi", &self.mc_rdi)
.field("mc_rsi", &self.mc_rsi)
.field("mc_rdx", &self.mc_rdx)
.field("mc_rcx", &self.mc_rcx)
.field("mc_r8", &self.mc_r8)
.field("mc_r9", &self.mc_r9)
.field("mc_rax", &self.mc_rax)
.field("mc_rbx", &self.mc_rbx)
.field("mc_rbp", &self.mc_rbp)
.field("mc_r10", &self.mc_r10)
.field("mc_r11", &self.mc_r11)
.field("mc_r12", &self.mc_r12)
.field("mc_r13", &self.mc_r13)
.field("mc_r14", &self.mc_r14)
.field("mc_r15", &self.mc_r15)
.field("mc_trapno", &self.mc_trapno)
.field("mc_fs", &self.mc_fs)
.field("mc_gs", &self.mc_gs)
.field("mc_addr", &self.mc_addr)
.field("mc_flags", &self.mc_flags)
.field("mc_es", &self.mc_es)
.field("mc_ds", &self.mc_ds)
.field("mc_err", &self.mc_err)
.field("mc_rip", &self.mc_rip)
.field("mc_cs", &self.mc_cs)
.field("mc_rflags", &self.mc_rflags)
.field("mc_rsp", &self.mc_rsp)
.field("mc_ss", &self.mc_ss)
.field("mc_len", &self.mc_len)
.field("mc_fpformat", &self.mc_fpformat)
.field("mc_ownedfp", &self.mc_ownedfp)
// FIXME: .field("mc_fpstate", &self.mc_fpstate)
.field("mc_fsbase", &self.mc_fsbase)
.field("mc_gsbase", &self.mc_gsbase)
.field("mc_xfpustate", &self.mc_xfpustate)
.field("mc_xfpustate_len", &self.mc_xfpustate_len)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash(&self, state: &mut H) {
self.mc_onstack.hash(state);
self.mc_rdi.hash(state);
self.mc_rsi.hash(state);
self.mc_rdx.hash(state);
self.mc_rcx.hash(state);
self.mc_r8.hash(state);
self.mc_r9.hash(state);
self.mc_rax.hash(state);
self.mc_rbx.hash(state);
self.mc_rbp.hash(state);
self.mc_r10.hash(state);
self.mc_r11.hash(state);
self.mc_r12.hash(state);
self.mc_r13.hash(state);
self.mc_r14.hash(state);
self.mc_r15.hash(state);
self.mc_trapno.hash(state);
self.mc_fs.hash(state);
self.mc_gs.hash(state);
self.mc_addr.hash(state);
self.mc_flags.hash(state);
self.mc_es.hash(state);
self.mc_ds.hash(state);
self.mc_err.hash(state);
self.mc_rip.hash(state);
self.mc_cs.hash(state);
self.mc_rflags.hash(state);
self.mc_rsp.hash(state);
self.mc_ss.hash(state);
self.mc_len.hash(state);
self.mc_fpformat.hash(state);
self.mc_ownedfp.hash(state);
self.mc_fpstate.hash(state);
self.mc_fsbase.hash(state);
self.mc_gsbase.hash(state);
self.mc_xfpustate.hash(state);
self.mc_xfpustate_len.hash(state);
self.mc_spare.hash(state);
}
}
}
}
s! {
pub struct ucontext_t {
pub uc_sigmask: ::sigset_t,
pub uc_mcontext: ::mcontext_t,
pub uc_link: *mut ::ucontext_t,
pub uc_stack: ::stack_t,
pub uc_flags: ::c_int,
__spare__: [::c_int; 4],
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs 0000644 0000000 0000000 00000025311 10461020230 0021204 0 ustar 0000000 0000000 pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type wchar_t = i32;
pub type time_t = i64;
pub type suseconds_t = i64;
pub type register_t = i64;
s! {
pub struct reg32 {
pub r_fs: u32,
pub r_es: u32,
pub r_ds: u32,
pub r_edi: u32,
pub r_esi: u32,
pub r_ebp: u32,
pub r_isp: u32,
pub r_ebx: u32,
pub r_edx: u32,
pub r_ecx: u32,
pub r_eax: u32,
pub r_trapno: u32,
pub r_err: u32,
pub r_eip: u32,
pub r_cs: u32,
pub r_eflags: u32,
pub r_esp: u32,
pub r_ss: u32,
pub r_gs: u32,
}
pub struct reg {
pub r_r15: i64,
pub r_r14: i64,
pub r_r13: i64,
pub r_r12: i64,
pub r_r11: i64,
pub r_r10: i64,
pub r_r9: i64,
pub r_r8: i64,
pub r_rdi: i64,
pub r_rsi: i64,
pub r_rbp: i64,
pub r_rbx: i64,
pub r_rdx: i64,
pub r_rcx: i64,
pub r_rax: i64,
pub r_trapno: u32,
pub r_fs: u16,
pub r_gs: u16,
pub r_err: u32,
pub r_es: u16,
pub r_ds: u16,
pub r_rip: i64,
pub r_cs: i64,
pub r_rflags: i64,
pub r_rsp: i64,
pub r_ss: i64,
}
}
s_no_extra_traits! {
pub struct fpreg32 {
pub fpr_env: [u32; 7],
pub fpr_acc: [[u8; 10]; 8],
pub fpr_ex_sw: u32,
pub fpr_pad: [u8; 64],
}
pub struct fpreg {
pub fpr_env: [u64; 4],
pub fpr_acc: [[u8; 16]; 8],
pub fpr_xacc: [[u8; 16]; 16],
pub fpr_spare: [u64; 12],
}
pub struct xmmreg {
pub xmm_env: [u32; 8],
pub xmm_acc: [[u8; 16]; 8],
pub xmm_reg: [[u8; 16]; 8],
pub xmm_pad: [u8; 224],
}
#[cfg(libc_union)]
pub union __c_anonymous_elf64_auxv_union {
pub a_val: ::c_long,
pub a_ptr: *mut ::c_void,
pub a_fcn: extern "C" fn(),
}
pub struct Elf64_Auxinfo {
pub a_type: ::c_long,
#[cfg(libc_union)]
pub a_un: __c_anonymous_elf64_auxv_union,
}
pub struct kinfo_file {
pub kf_structsize: ::c_int,
pub kf_type: ::c_int,
pub kf_fd: ::c_int,
pub kf_ref_count: ::c_int,
pub kf_flags: ::c_int,
_kf_pad0: ::c_int,
pub kf_offset: i64,
_priv: [::uintptr_t; 38], // FIXME if needed
pub kf_status: u16,
_kf_pad1: u16,
_kf_ispare0: ::c_int,
pub kf_cap_rights: ::cap_rights_t,
_kf_cap_spare: u64,
pub kf_path: [::c_char; ::PATH_MAX as usize],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for fpreg32 {
fn eq(&self, other: &fpreg32) -> bool {
self.fpr_env == other.fpr_env &&
self.fpr_acc == other.fpr_acc &&
self.fpr_ex_sw == other.fpr_ex_sw &&
self.fpr_pad
.iter()
.zip(other.fpr_pad.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for fpreg32 {}
impl ::fmt::Debug for fpreg32 {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpreg32")
.field("fpr_env", &&self.fpr_env[..])
.field("fpr_acc", &self.fpr_acc)
.field("fpr_ex_sw", &self.fpr_ex_sw)
.field("fpr_pad", &&self.fpr_pad[..])
.finish()
}
}
impl ::hash::Hash for fpreg32 {
fn hash(&self, state: &mut H) {
self.fpr_env.hash(state);
self.fpr_acc.hash(state);
self.fpr_ex_sw.hash(state);
self.fpr_pad.hash(state);
}
}
impl PartialEq for fpreg {
fn eq(&self, other: &fpreg) -> bool {
self.fpr_env == other.fpr_env &&
self.fpr_acc == other.fpr_acc &&
self.fpr_xacc == other.fpr_xacc &&
self.fpr_spare == other.fpr_spare
}
}
impl Eq for fpreg {}
impl ::fmt::Debug for fpreg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("fpreg")
.field("fpr_env", &self.fpr_env)
.field("fpr_acc", &self.fpr_acc)
.field("fpr_xacc", &self.fpr_xacc)
.field("fpr_spare", &self.fpr_spare)
.finish()
}
}
impl ::hash::Hash for fpreg {
fn hash(&self, state: &mut H) {
self.fpr_env.hash(state);
self.fpr_acc.hash(state);
self.fpr_xacc.hash(state);
self.fpr_spare.hash(state);
}
}
impl PartialEq for xmmreg {
fn eq(&self, other: &xmmreg) -> bool {
self.xmm_env == other.xmm_env &&
self.xmm_acc == other.xmm_acc &&
self.xmm_reg == other.xmm_reg &&
self.xmm_pad
.iter()
.zip(other.xmm_pad.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for xmmreg {}
impl ::fmt::Debug for xmmreg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("xmmreg")
.field("xmm_env", &self.xmm_env)
.field("xmm_acc", &self.xmm_acc)
.field("xmm_reg", &self.xmm_reg)
.field("xmm_pad", &&self.xmm_pad[..])
.finish()
}
}
impl ::hash::Hash for xmmreg {
fn hash(&self, state: &mut H) {
self.xmm_env.hash(state);
self.xmm_acc.hash(state);
self.xmm_reg.hash(state);
self.xmm_pad.hash(state);
}
}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_elf64_auxv_union {
fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool {
unsafe { self.a_val == other.a_val
|| self.a_ptr == other.a_ptr
|| self.a_fcn == other.a_fcn }
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_elf64_auxv_union {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_elf64_auxv_union {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("a_val")
.field("a_val", unsafe { &self.a_val })
.finish()
}
}
#[cfg(not(libc_union))]
impl PartialEq for Elf64_Auxinfo {
fn eq(&self, other: &Elf64_Auxinfo) -> bool {
self.a_type == other.a_type
}
}
#[cfg(libc_union)]
impl PartialEq for Elf64_Auxinfo {
fn eq(&self, other: &Elf64_Auxinfo) -> bool {
self.a_type == other.a_type
&& self.a_un == other.a_un
}
}
impl Eq for Elf64_Auxinfo {}
#[cfg(not(libc_union))]
impl ::fmt::Debug for Elf64_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf64_Auxinfo")
.field("a_type", &self.a_type)
.finish()
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for Elf64_Auxinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("Elf64_Auxinfo")
.field("a_type", &self.a_type)
.field("a_un", &self.a_un)
.finish()
}
}
impl PartialEq for kinfo_file {
fn eq(&self, other: &kinfo_file) -> bool {
self.kf_structsize == other.kf_structsize &&
self.kf_type == other.kf_type &&
self.kf_fd == other.kf_fd &&
self.kf_ref_count == other.kf_ref_count &&
self.kf_flags == other.kf_flags &&
self.kf_offset == other.kf_offset &&
self.kf_status == other.kf_status &&
self.kf_cap_rights == other.kf_cap_rights &&
self.kf_path
.iter()
.zip(other.kf_path.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for kinfo_file {}
impl ::fmt::Debug for kinfo_file {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("kinfo_file")
.field("kf_structsize", &self.kf_structsize)
.field("kf_type", &self.kf_type)
.field("kf_fd", &self.kf_fd)
.field("kf_ref_count", &self.kf_ref_count)
.field("kf_flags", &self.kf_flags)
.field("kf_offset", &self.kf_offset)
.field("kf_status", &self.kf_status)
.field("kf_cap_rights", &self.kf_cap_rights)
.field("kf_path", &&self.kf_path[..])
.finish()
}
}
impl ::hash::Hash for kinfo_file {
fn hash(&self, state: &mut H) {
self.kf_structsize.hash(state);
self.kf_type.hash(state);
self.kf_fd.hash(state);
self.kf_ref_count.hash(state);
self.kf_flags.hash(state);
self.kf_offset.hash(state);
self.kf_status.hash(state);
self.kf_cap_rights.hash(state);
self.kf_path.hash(state);
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
pub const _MC_HASSEGS: u32 = 0x1;
pub const _MC_HASBASES: u32 = 0x2;
pub const _MC_HASFPXSTATE: u32 = 0x4;
pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE;
pub const _MC_FPFMT_NODEV: c_long = 0x10000;
pub const _MC_FPFMT_XMM: c_long = 0x10002;
pub const _MC_FPOWNED_NONE: c_long = 0x20000;
pub const _MC_FPOWNED_FPU: c_long = 0x20001;
pub const _MC_FPOWNED_PCB: c_long = 0x20002;
cfg_if! {
if #[cfg(libc_align)] {
mod align;
pub use self::align::*;
}
}
libc-0.2.152/src/unix/bsd/freebsdlike/mod.rs 0000644 0000000 0000000 00000174036 10461020230 0016645 0 ustar 0000000 0000000 pub type mode_t = u16;
pub type pthread_attr_t = *mut ::c_void;
pub type rlim_t = i64;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_rwlock_t = *mut ::c_void;
pub type pthread_rwlockattr_t = *mut ::c_void;
pub type pthread_key_t = ::c_int;
pub type tcflag_t = ::c_uint;
pub type speed_t = ::c_uint;
pub type nl_item = ::c_int;
pub type id_t = i64;
pub type vm_size_t = ::uintptr_t;
pub type key_t = ::c_long;
// elf.h
pub type Elf32_Addr = u32;
pub type Elf32_Half = u16;
pub type Elf32_Lword = u64;
pub type Elf32_Off = u32;
pub type Elf32_Sword = i32;
pub type Elf32_Word = u32;
pub type Elf64_Addr = u64;
pub type Elf64_Half = u16;
pub type Elf64_Lword = u64;
pub type Elf64_Off = u64;
pub type Elf64_Sword = i32;
pub type Elf64_Sxword = i64;
pub type Elf64_Word = u32;
pub type Elf64_Xword = u64;
pub type iconv_t = *mut ::c_void;
// It's an alias over "struct __kvm_t". However, its fields aren't supposed to be used directly,
// making the type definition system dependent. Better not bind it exactly.
pub type kvm_t = ::c_void;
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
type Elf_Half = Elf64_Half;
type Elf_Phdr = Elf64_Phdr;
} else if #[cfg(target_pointer_width = "32")] {
type Elf_Addr = Elf32_Addr;
type Elf_Half = Elf32_Half;
type Elf_Phdr = Elf32_Phdr;
}
}
// link.h
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
impl ::Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}
pub unsafe fn si_value(&self) -> ::sigval {
self.si_value
}
pub unsafe fn si_pid(&self) -> ::pid_t {
self.si_pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
self.si_uid
}
pub unsafe fn si_status(&self) -> ::c_int {
self.si_status
}
}
s! {
pub struct in_addr {
pub s_addr: ::in_addr_t,
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: ::c_int,
}
pub struct ip_mreq_source {
pub imr_multiaddr: in_addr,
pub imr_sourceaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_matchc: ::size_t,
pub gl_offs: ::size_t,
pub gl_flags: ::c_int,
pub gl_pathv: *mut *mut ::c_char,
__unused3: *mut ::c_void,
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
__unused6: *mut ::c_void,
__unused7: *mut ::c_void,
__unused8: *mut ::c_void,
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::socklen_t,
pub ai_canonname: *mut ::c_char,
pub ai_addr: *mut ::sockaddr,
pub ai_next: *mut addrinfo,
}
pub struct sigset_t {
bits: [u32; 4],
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_errno: ::c_int,
pub si_code: ::c_int,
pub si_pid: ::pid_t,
pub si_uid: ::uid_t,
pub si_status: ::c_int,
pub si_addr: *mut ::c_void,
pub si_value: ::sigval,
_pad1: ::c_long,
_pad2: [::c_int; 7],
}
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_flags: ::c_int,
pub sa_mask: sigset_t,
}
pub struct sched_param {
pub sched_priority: ::c_int,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *mut ::c_void,
}
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: ::sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [::c_char; 8],
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_cc: [::cc_t; ::NCCS],
pub c_ispeed: ::speed_t,
pub c_ospeed: ::speed_t,
}
pub struct flock {
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
pub l_type: ::c_short,
pub l_whence: ::c_short,
#[cfg(not(target_os = "dragonfly"))]
pub l_sysid: ::c_int,
}
pub struct sf_hdtr {
pub headers: *mut ::iovec,
pub hdr_cnt: ::c_int,
pub trailers: *mut ::iovec,
pub trl_cnt: ::c_int,
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct cmsgcred {
pub cmcred_pid: ::pid_t,
pub cmcred_uid: ::uid_t,
pub cmcred_euid: ::uid_t,
pub cmcred_gid: ::gid_t,
pub cmcred_ngroups: ::c_short,
pub cmcred_groups: [::gid_t; CMGROUP_MAX],
}
pub struct rtprio {
pub type_: ::c_ushort,
pub prio: ::c_ushort,
}
pub struct in6_pktinfo {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_uint,
}
pub struct arphdr {
pub ar_hrd: u16,
pub ar_pro: u16,
pub ar_hln: u8,
pub ar_pln: u8,
pub ar_op: u16,
}
pub struct timex {
pub modes: ::c_uint,
pub offset: ::c_long,
pub freq: ::c_long,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub status: ::c_int,
pub constant: ::c_long,
pub precision: ::c_long,
pub tolerance: ::c_long,
pub ppsfreq: ::c_long,
pub jitter: ::c_long,
pub shift: ::c_int,
pub stabil: ::c_long,
pub jitcnt: ::c_long,
pub calcnt: ::c_long,
pub errcnt: ::c_long,
pub stbcnt: ::c_long,
}
pub struct ntptimeval {
pub time: ::timespec,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub tai: ::c_long,
pub time_state: ::c_int,
}
pub struct accept_filter_arg {
pub af_name: [::c_char; 16],
af_arg: [[::c_char; 10]; 24],
}
pub struct ptrace_io_desc {
pub piod_op: ::c_int,
pub piod_offs: *mut ::c_void,
pub piod_addr: *mut ::c_void,
pub piod_len: ::size_t,
}
// bpf.h
pub struct bpf_program {
pub bf_len: ::c_uint,
pub bf_insns: *mut bpf_insn,
}
pub struct bpf_stat {
pub bs_recv: ::c_uint,
pub bs_drop: ::c_uint,
}
pub struct bpf_version {
pub bv_major: ::c_ushort,
pub bv_minor: ::c_ushort,
}
pub struct bpf_hdr {
pub bh_tstamp: ::timeval,
pub bh_caplen: u32,
pub bh_datalen: u32,
pub bh_hdrlen: ::c_ushort,
}
pub struct bpf_insn {
pub code: ::c_ushort,
pub jt: ::c_uchar,
pub jf: ::c_uchar,
pub k: u32,
}
pub struct bpf_dltlist {
bfl_len: ::c_uint,
bfl_list: *mut ::c_uint,
}
// elf.h
pub struct Elf32_Phdr {
pub p_type: Elf32_Word,
pub p_offset: Elf32_Off,
pub p_vaddr: Elf32_Addr,
pub p_paddr: Elf32_Addr,
pub p_filesz: Elf32_Word,
pub p_memsz: Elf32_Word,
pub p_flags: Elf32_Word,
pub p_align: Elf32_Word,
}
pub struct Elf64_Phdr {
pub p_type: Elf64_Word,
pub p_flags: Elf64_Word,
pub p_offset: Elf64_Off,
pub p_vaddr: Elf64_Addr,
pub p_paddr: Elf64_Addr,
pub p_filesz: Elf64_Xword,
pub p_memsz: Elf64_Xword,
pub p_align: Elf64_Xword,
}
// link.h
pub struct dl_phdr_info {
pub dlpi_addr: Elf_Addr,
pub dlpi_name: *const ::c_char,
pub dlpi_phdr: *const Elf_Phdr,
pub dlpi_phnum: Elf_Half,
pub dlpi_adds: ::c_ulonglong,
pub dlpi_subs: ::c_ulonglong,
pub dlpi_tls_modid: usize,
pub dlpi_tls_data: *mut ::c_void,
}
pub struct ipc_perm {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mode: ::mode_t,
pub seq: ::c_ushort,
pub key: ::key_t,
}
pub struct eui64 {
pub octet: [u8; EUI64_LEN],
}
}
s_no_extra_traits! {
pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: ::sa_family_t,
__ss_pad1: [u8; 6],
__ss_align: i64,
__ss_pad2: [u8; 112],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for sockaddr_storage {
fn eq(&self, other: &sockaddr_storage) -> bool {
self.ss_len == other.ss_len
&& self.ss_family == other.ss_family
&& self.__ss_pad1 == other.__ss_pad1
&& self.__ss_align == other.__ss_align
&& self
.__ss_pad2
.iter()
.zip(other.__ss_pad2.iter())
.all(|(a, b)| a == b)
}
}
impl Eq for sockaddr_storage {}
impl ::fmt::Debug for sockaddr_storage {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_storage")
.field("ss_len", &self.ss_len)
.field("ss_family", &self.ss_family)
.field("__ss_pad1", &self.__ss_pad1)
.field("__ss_align", &self.__ss_align)
// FIXME: .field("__ss_pad2", &self.__ss_pad2)
.finish()
}
}
impl ::hash::Hash for sockaddr_storage {
fn hash(&self, state: &mut H) {
self.ss_len.hash(state);
self.ss_family.hash(state);
self.__ss_pad1.hash(state);
self.__ss_align.hash(state);
self.__ss_pad2.hash(state);
}
}
}
}
// Non-public helper constant
cfg_if! {
if #[cfg(all(not(libc_const_size_of), target_pointer_width = "32"))] {
const SIZEOF_LONG: usize = 4;
} else if #[cfg(all(not(libc_const_size_of), target_pointer_width = "64"))] {
const SIZEOF_LONG: usize = 8;
} else if #[cfg(libc_const_size_of)] {
const SIZEOF_LONG: usize = ::mem::size_of::<::c_long>();
}
}
#[deprecated(
since = "0.2.64",
note = "Can vary at runtime. Use sysconf(3) instead"
)]
pub const AIO_LISTIO_MAX: ::c_int = 16;
pub const AIO_CANCELED: ::c_int = 1;
pub const AIO_NOTCANCELED: ::c_int = 2;
pub const AIO_ALLDONE: ::c_int = 3;
pub const LIO_NOP: ::c_int = 0;
pub const LIO_WRITE: ::c_int = 1;
pub const LIO_READ: ::c_int = 2;
pub const LIO_WAIT: ::c_int = 1;
pub const LIO_NOWAIT: ::c_int = 0;
pub const SIGEV_NONE: ::c_int = 0;
pub const SIGEV_SIGNAL: ::c_int = 1;
pub const SIGEV_THREAD: ::c_int = 2;
pub const SIGEV_KEVENT: ::c_int = 3;
pub const CODESET: ::nl_item = 0;
pub const D_T_FMT: ::nl_item = 1;
pub const D_FMT: ::nl_item = 2;
pub const T_FMT: ::nl_item = 3;
pub const T_FMT_AMPM: ::nl_item = 4;
pub const AM_STR: ::nl_item = 5;
pub const PM_STR: ::nl_item = 6;
pub const DAY_1: ::nl_item = 7;
pub const DAY_2: ::nl_item = 8;
pub const DAY_3: ::nl_item = 9;
pub const DAY_4: ::nl_item = 10;
pub const DAY_5: ::nl_item = 11;
pub const DAY_6: ::nl_item = 12;
pub const DAY_7: ::nl_item = 13;
pub const ABDAY_1: ::nl_item = 14;
pub const ABDAY_2: ::nl_item = 15;
pub const ABDAY_3: ::nl_item = 16;
pub const ABDAY_4: ::nl_item = 17;
pub const ABDAY_5: ::nl_item = 18;
pub const ABDAY_6: ::nl_item = 19;
pub const ABDAY_7: ::nl_item = 20;
pub const MON_1: ::nl_item = 21;
pub const MON_2: ::nl_item = 22;
pub const MON_3: ::nl_item = 23;
pub const MON_4: ::nl_item = 24;
pub const MON_5: ::nl_item = 25;
pub const MON_6: ::nl_item = 26;
pub const MON_7: ::nl_item = 27;
pub const MON_8: ::nl_item = 28;
pub const MON_9: ::nl_item = 29;
pub const MON_10: ::nl_item = 30;
pub const MON_11: ::nl_item = 31;
pub const MON_12: ::nl_item = 32;
pub const ABMON_1: ::nl_item = 33;
pub const ABMON_2: ::nl_item = 34;
pub const ABMON_3: ::nl_item = 35;
pub const ABMON_4: ::nl_item = 36;
pub const ABMON_5: ::nl_item = 37;
pub const ABMON_6: ::nl_item = 38;
pub const ABMON_7: ::nl_item = 39;
pub const ABMON_8: ::nl_item = 40;
pub const ABMON_9: ::nl_item = 41;
pub const ABMON_10: ::nl_item = 42;
pub const ABMON_11: ::nl_item = 43;
pub const ABMON_12: ::nl_item = 44;
pub const ERA: ::nl_item = 45;
pub const ERA_D_FMT: ::nl_item = 46;
pub const ERA_D_T_FMT: ::nl_item = 47;
pub const ERA_T_FMT: ::nl_item = 48;
pub const ALT_DIGITS: ::nl_item = 49;
pub const RADIXCHAR: ::nl_item = 50;
pub const THOUSEP: ::nl_item = 51;
pub const YESEXPR: ::nl_item = 52;
pub const NOEXPR: ::nl_item = 53;
pub const YESSTR: ::nl_item = 54;
pub const NOSTR: ::nl_item = 55;
pub const CRNCYSTR: ::nl_item = 56;
pub const D_MD_ORDER: ::nl_item = 57;
pub const ALTMON_1: ::nl_item = 58;
pub const ALTMON_2: ::nl_item = 59;
pub const ALTMON_3: ::nl_item = 60;
pub const ALTMON_4: ::nl_item = 61;
pub const ALTMON_5: ::nl_item = 62;
pub const ALTMON_6: ::nl_item = 63;
pub const ALTMON_7: ::nl_item = 64;
pub const ALTMON_8: ::nl_item = 65;
pub const ALTMON_9: ::nl_item = 66;
pub const ALTMON_10: ::nl_item = 67;
pub const ALTMON_11: ::nl_item = 68;
pub const ALTMON_12: ::nl_item = 69;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const SEEK_DATA: ::c_int = 3;
pub const SEEK_HOLE: ::c_int = 4;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
pub const BUFSIZ: ::c_uint = 1024;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 1024;
pub const TMP_MAX: ::c_uint = 308915776;
pub const O_NOCTTY: ::c_int = 32768;
pub const O_DIRECT: ::c_int = 0x00010000;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
pub const S_IFDIR: mode_t = 16384;
pub const S_IFREG: mode_t = 32768;
pub const S_IFLNK: mode_t = 40960;
pub const S_IFSOCK: mode_t = 49152;
pub const S_IFMT: mode_t = 61440;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const S_IRWXU: mode_t = 448;
pub const S_IXUSR: mode_t = 64;
pub const S_IWUSR: mode_t = 128;
pub const S_IRUSR: mode_t = 256;
pub const S_IRWXG: mode_t = 56;
pub const S_IXGRP: mode_t = 8;
pub const S_IWGRP: mode_t = 16;
pub const S_IRGRP: mode_t = 32;
pub const S_IRWXO: mode_t = 7;
pub const S_IXOTH: mode_t = 1;
pub const S_IWOTH: mode_t = 2;
pub const S_IROTH: mode_t = 4;
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_DUPFD_CLOEXEC: ::c_int = 17;
pub const F_DUP2FD: ::c_int = 10;
pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGEMT: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MNT_EXPUBLIC: ::c_int = 0x20000000;
pub const MNT_NOATIME: ::c_int = 0x10000000;
pub const MNT_NOCLUSTERR: ::c_int = 0x40000000;
pub const MNT_NOCLUSTERW: ::c_int = 0x80000000;
pub const MNT_NOSYMFOLLOW: ::c_int = 0x00400000;
pub const MNT_SOFTDEP: ::c_int = 0x00200000;
pub const MNT_SUIDDIR: ::c_int = 0x00100000;
pub const MNT_EXRDONLY: ::c_int = 0x00000080;
pub const MNT_DEFEXPORTED: ::c_int = 0x00000200;
pub const MNT_EXPORTANON: ::c_int = 0x00000400;
pub const MNT_EXKERB: ::c_int = 0x00000800;
pub const MNT_DELEXPORT: ::c_int = 0x00020000;
pub const MS_SYNC: ::c_int = 0x0000;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const MS_INVALIDATE: ::c_int = 0x0002;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EDEADLK: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const EAGAIN: ::c_int = 35;
pub const EWOULDBLOCK: ::c_int = 35;
pub const EINPROGRESS: ::c_int = 36;
pub const EALREADY: ::c_int = 37;
pub const ENOTSOCK: ::c_int = 38;
pub const EDESTADDRREQ: ::c_int = 39;
pub const EMSGSIZE: ::c_int = 40;
pub const EPROTOTYPE: ::c_int = 41;
pub const ENOPROTOOPT: ::c_int = 42;
pub const EPROTONOSUPPORT: ::c_int = 43;
pub const ESOCKTNOSUPPORT: ::c_int = 44;
pub const EOPNOTSUPP: ::c_int = 45;
pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EPFNOSUPPORT: ::c_int = 46;
pub const EAFNOSUPPORT: ::c_int = 47;
pub const EADDRINUSE: ::c_int = 48;
pub const EADDRNOTAVAIL: ::c_int = 49;
pub const ENETDOWN: ::c_int = 50;
pub const ENETUNREACH: ::c_int = 51;
pub const ENETRESET: ::c_int = 52;
pub const ECONNABORTED: ::c_int = 53;
pub const ECONNRESET: ::c_int = 54;
pub const ENOBUFS: ::c_int = 55;
pub const EISCONN: ::c_int = 56;
pub const ENOTCONN: ::c_int = 57;
pub const ESHUTDOWN: ::c_int = 58;
pub const ETOOMANYREFS: ::c_int = 59;
pub const ETIMEDOUT: ::c_int = 60;
pub const ECONNREFUSED: ::c_int = 61;
pub const ELOOP: ::c_int = 62;
pub const ENAMETOOLONG: ::c_int = 63;
pub const EHOSTDOWN: ::c_int = 64;
pub const EHOSTUNREACH: ::c_int = 65;
pub const ENOTEMPTY: ::c_int = 66;
pub const EPROCLIM: ::c_int = 67;
pub const EUSERS: ::c_int = 68;
pub const EDQUOT: ::c_int = 69;
pub const ESTALE: ::c_int = 70;
pub const EREMOTE: ::c_int = 71;
pub const EBADRPC: ::c_int = 72;
pub const ERPCMISMATCH: ::c_int = 73;
pub const EPROGUNAVAIL: ::c_int = 74;
pub const EPROGMISMATCH: ::c_int = 75;
pub const EPROCUNAVAIL: ::c_int = 76;
pub const ENOLCK: ::c_int = 77;
pub const ENOSYS: ::c_int = 78;
pub const EFTYPE: ::c_int = 79;
pub const EAUTH: ::c_int = 80;
pub const ENEEDAUTH: ::c_int = 81;
pub const EIDRM: ::c_int = 82;
pub const ENOMSG: ::c_int = 83;
pub const EOVERFLOW: ::c_int = 84;
pub const ECANCELED: ::c_int = 85;
pub const EILSEQ: ::c_int = 86;
pub const ENOATTR: ::c_int = 87;
pub const EDOOFUS: ::c_int = 88;
pub const EBADMSG: ::c_int = 89;
pub const EMULTIHOP: ::c_int = 90;
pub const ENOLINK: ::c_int = 91;
pub const EPROTO: ::c_int = 92;
pub const POLLSTANDARD: ::c_short = ::POLLIN
| ::POLLPRI
| ::POLLOUT
| ::POLLRDNORM
| ::POLLRDBAND
| ::POLLWRBAND
| ::POLLERR
| ::POLLHUP
| ::POLLNVAL;
pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00000008;
pub const AI_ALL: ::c_int = 0x00000100;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
pub const AI_V4MAPPED: ::c_int = 0x00000800;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
pub const EAI_FAMILY: ::c_int = 5;
pub const EAI_MEMORY: ::c_int = 6;
pub const EAI_NONAME: ::c_int = 8;
pub const EAI_SERVICE: ::c_int = 9;
pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
pub const EAI_OVERFLOW: ::c_int = 14;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const SIGTRAP: ::c_int = 5;
pub const GLOB_APPEND: ::c_int = 0x0001;
pub const GLOB_DOOFFS: ::c_int = 0x0002;
pub const GLOB_ERR: ::c_int = 0x0004;
pub const GLOB_MARK: ::c_int = 0x0008;
pub const GLOB_NOCHECK: ::c_int = 0x0010;
pub const GLOB_NOSORT: ::c_int = 0x0020;
pub const GLOB_NOESCAPE: ::c_int = 0x2000;
pub const GLOB_NOSPACE: ::c_int = -1;
pub const GLOB_ABORTED: ::c_int = -2;
pub const GLOB_NOMATCH: ::c_int = -3;
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_MEMLOCK: ::c_int = 6;
pub const RLIMIT_NPROC: ::c_int = 7;
pub const RLIMIT_NOFILE: ::c_int = 8;
pub const RLIMIT_SBSIZE: ::c_int = 9;
pub const RLIMIT_VMEM: ::c_int = 10;
pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
pub const RUSAGE_SELF: ::c_int = 0;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_VIRTUAL: ::clockid_t = 1;
pub const CLOCK_PROF: ::clockid_t = 2;
pub const CLOCK_MONOTONIC: ::clockid_t = 4;
pub const CLOCK_UPTIME: ::clockid_t = 5;
pub const CLOCK_UPTIME_PRECISE: ::clockid_t = 7;
pub const CLOCK_UPTIME_FAST: ::clockid_t = 8;
pub const CLOCK_REALTIME_PRECISE: ::clockid_t = 9;
pub const CLOCK_REALTIME_FAST: ::clockid_t = 10;
pub const CLOCK_MONOTONIC_PRECISE: ::clockid_t = 11;
pub const CLOCK_MONOTONIC_FAST: ::clockid_t = 12;
pub const CLOCK_SECOND: ::clockid_t = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 5;
pub const MADV_NOSYNC: ::c_int = 6;
pub const MADV_AUTOSYNC: ::c_int = 7;
pub const MADV_NOCORE: ::c_int = 8;
pub const MADV_CORE: ::c_int = 9;
pub const MINCORE_INCORE: ::c_int = 0x1;
pub const MINCORE_REFERENCED: ::c_int = 0x2;
pub const MINCORE_MODIFIED: ::c_int = 0x4;
pub const MINCORE_REFERENCED_OTHER: ::c_int = 0x8;
pub const MINCORE_MODIFIED_OTHER: ::c_int = 0x10;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_INET: ::c_int = 2;
pub const AF_IMPLINK: ::c_int = 3;
pub const AF_PUP: ::c_int = 4;
pub const AF_CHAOS: ::c_int = 5;
pub const AF_NETBIOS: ::c_int = 6;
pub const AF_ISO: ::c_int = 7;
pub const AF_OSI: ::c_int = AF_ISO;
pub const AF_ECMA: ::c_int = 8;
pub const AF_DATAKIT: ::c_int = 9;
pub const AF_CCITT: ::c_int = 10;
pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_LINK: ::c_int = 18;
pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_COIP: ::c_int = 20;
pub const AF_CNT: ::c_int = 21;
pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_SIP: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
pub const AF_ISDN: ::c_int = 26;
pub const AF_E164: ::c_int = AF_ISDN;
pub const pseudo_AF_KEY: ::c_int = 27;
pub const AF_INET6: ::c_int = 28;
pub const AF_NATM: ::c_int = 29;
pub const AF_ATM: ::c_int = 30;
pub const pseudo_AF_HDRCMPLT: ::c_int = 31;
pub const AF_NETGRAPH: ::c_int = 32;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_LOCAL: ::c_int = AF_LOCAL;
pub const PF_UNIX: ::c_int = PF_LOCAL;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
pub const PF_PUP: ::c_int = AF_PUP;
pub const PF_CHAOS: ::c_int = AF_CHAOS;
pub const PF_NETBIOS: ::c_int = AF_NETBIOS;
pub const PF_ISO: ::c_int = AF_ISO;
pub const PF_OSI: ::c_int = AF_ISO;
pub const PF_ECMA: ::c_int = AF_ECMA;
pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
pub const PF_CCITT: ::c_int = AF_CCITT;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_DLI: ::c_int = AF_DLI;
pub const PF_LAT: ::c_int = AF_LAT;
pub const PF_HYLINK: ::c_int = AF_HYLINK;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_ROUTE: ::c_int = AF_ROUTE;
pub const PF_LINK: ::c_int = AF_LINK;
pub const PF_XTP: ::c_int = pseudo_AF_XTP;
pub const PF_COIP: ::c_int = AF_COIP;
pub const PF_CNT: ::c_int = AF_CNT;
pub const PF_SIP: ::c_int = AF_SIP;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_NATM: ::c_int = AF_NATM;
pub const PF_ATM: ::c_int = AF_ATM;
pub const PF_NETGRAPH: ::c_int = AF_NETGRAPH;
pub const PIOD_READ_D: ::c_int = 1;
pub const PIOD_WRITE_D: ::c_int = 2;
pub const PIOD_READ_I: ::c_int = 3;
pub const PIOD_WRITE_I: ::c_int = 4;
pub const PT_TRACE_ME: ::c_int = 0;
pub const PT_READ_I: ::c_int = 1;
pub const PT_READ_D: ::c_int = 2;
pub const PT_WRITE_I: ::c_int = 4;
pub const PT_WRITE_D: ::c_int = 5;
pub const PT_CONTINUE: ::c_int = 7;
pub const PT_KILL: ::c_int = 8;
pub const PT_STEP: ::c_int = 9;
pub const PT_ATTACH: ::c_int = 10;
pub const PT_DETACH: ::c_int = 11;
pub const PT_IO: ::c_int = 12;
pub const SOMAXCONN: ::c_int = 128;
pub const MSG_OOB: ::c_int = 0x00000001;
pub const MSG_PEEK: ::c_int = 0x00000002;
pub const MSG_DONTROUTE: ::c_int = 0x00000004;
pub const MSG_EOR: ::c_int = 0x00000008;
pub const MSG_TRUNC: ::c_int = 0x00000010;
pub const MSG_CTRUNC: ::c_int = 0x00000020;
pub const MSG_WAITALL: ::c_int = 0x00000040;
pub const MSG_DONTWAIT: ::c_int = 0x00000080;
pub const MSG_EOF: ::c_int = 0x00000100;
pub const SCM_TIMESTAMP: ::c_int = 0x02;
pub const SCM_CREDS: ::c_int = 0x03;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
pub const SOCK_MAXADDRLEN: ::c_int = 255;
pub const IP_TTL: ::c_int = 4;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IP_RECVIF: ::c_int = 20;
pub const IPV6_JOIN_GROUP: ::c_int = 12;
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const IPV6_CHECKSUM: ::c_int = 26;
pub const IPV6_RECVPKTINFO: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_HOPLIMIT: ::c_int = 47;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
pub const IPV6_DONTFRAG: ::c_int = 62;
pub const IP_ADD_SOURCE_MEMBERSHIP: ::c_int = 70;
pub const IP_DROP_SOURCE_MEMBERSHIP: ::c_int = 71;
pub const IP_BLOCK_SOURCE: ::c_int = 72;
pub const IP_UNBLOCK_SOURCE: ::c_int = 73;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;
pub const TCP_KEEPIDLE: ::c_int = 256;
pub const TCP_KEEPINTVL: ::c_int = 512;
pub const TCP_KEEPCNT: ::c_int = 1024;
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_USELOOPBACK: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_TIMESTAMP: ::c_int = 0x0400;
pub const SO_NOSIGPIPE: ::c_int = 0x0800;
pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_SNDTIMEO: ::c_int = 0x1005;
pub const SO_RCVTIMEO: ::c_int = 0x1006;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const LOCAL_PEERCRED: ::c_int = 1;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
pub const MAP_COPY: ::c_int = 0x0002;
#[doc(hidden)]
#[deprecated(
since = "0.2.54",
note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
)]
pub const MAP_RENAME: ::c_int = 0x0020;
#[doc(hidden)]
#[deprecated(
since = "0.2.54",
note = "Removed in FreeBSD 11, unused in DragonFlyBSD"
)]
pub const MAP_NORESERVE: ::c_int = 0x0040;
pub const MAP_HASSEMAPHORE: ::c_int = 0x0200;
pub const MAP_STACK: ::c_int = 0x0400;
pub const MAP_NOSYNC: ::c_int = 0x0800;
pub const MAP_NOCORE: ::c_int = 0x020000;
pub const IPPROTO_RAW: ::c_int = 255;
pub const _PC_LINK_MAX: ::c_int = 1;
pub const _PC_MAX_CANON: ::c_int = 2;
pub const _PC_MAX_INPUT: ::c_int = 3;
pub const _PC_NAME_MAX: ::c_int = 4;
pub const _PC_PATH_MAX: ::c_int = 5;
pub const _PC_PIPE_BUF: ::c_int = 6;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
pub const _PC_NO_TRUNC: ::c_int = 8;
pub const _PC_VDISABLE: ::c_int = 9;
pub const _PC_ALLOC_SIZE_MIN: ::c_int = 10;
pub const _PC_FILESIZEBITS: ::c_int = 12;
pub const _PC_REC_INCR_XFER_SIZE: ::c_int = 14;
pub const _PC_REC_MAX_XFER_SIZE: ::c_int = 15;
pub const _PC_REC_MIN_XFER_SIZE: ::c_int = 16;
pub const _PC_REC_XFER_ALIGN: ::c_int = 17;
pub const _PC_SYMLINK_MAX: ::c_int = 18;
pub const _PC_MIN_HOLE_SIZE: ::c_int = 21;
pub const _PC_ASYNC_IO: ::c_int = 53;
pub const _PC_PRIO_IO: ::c_int = 54;
pub const _PC_SYNC_IO: ::c_int = 55;
pub const _PC_ACL_EXTENDED: ::c_int = 59;
pub const _PC_ACL_PATH_MAX: ::c_int = 60;
pub const _PC_CAP_PRESENT: ::c_int = 61;
pub const _PC_INF_PRESENT: ::c_int = 62;
pub const _PC_MAC_PRESENT: ::c_int = 63;
pub const _SC_ARG_MAX: ::c_int = 1;
pub const _SC_CHILD_MAX: ::c_int = 2;
pub const _SC_CLK_TCK: ::c_int = 3;
pub const _SC_NGROUPS_MAX: ::c_int = 4;
pub const _SC_OPEN_MAX: ::c_int = 5;
pub const _SC_JOB_CONTROL: ::c_int = 6;
pub const _SC_SAVED_IDS: ::c_int = 7;
pub const _SC_VERSION: ::c_int = 8;
pub const _SC_BC_BASE_MAX: ::c_int = 9;
pub const _SC_BC_DIM_MAX: ::c_int = 10;
pub const _SC_BC_SCALE_MAX: ::c_int = 11;
pub const _SC_BC_STRING_MAX: ::c_int = 12;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
pub const _SC_LINE_MAX: ::c_int = 15;
pub const _SC_RE_DUP_MAX: ::c_int = 16;
pub const _SC_2_VERSION: ::c_int = 17;
pub const _SC_2_C_BIND: ::c_int = 18;
pub const _SC_2_C_DEV: ::c_int = 19;
pub const _SC_2_CHAR_TERM: ::c_int = 20;
pub const _SC_2_FORT_DEV: ::c_int = 21;
pub const _SC_2_FORT_RUN: ::c_int = 22;
pub const _SC_2_LOCALEDEF: ::c_int = 23;
pub const _SC_2_SW_DEV: ::c_int = 24;
pub const _SC_2_UPE: ::c_int = 25;
pub const _SC_STREAM_MAX: ::c_int = 26;
pub const _SC_TZNAME_MAX: ::c_int = 27;
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 28;
pub const _SC_MAPPED_FILES: ::c_int = 29;
pub const _SC_MEMLOCK: ::c_int = 30;
pub const _SC_MEMLOCK_RANGE: ::c_int = 31;
pub const _SC_MEMORY_PROTECTION: ::c_int = 32;
pub const _SC_MESSAGE_PASSING: ::c_int = 33;
pub const _SC_PRIORITIZED_IO: ::c_int = 34;
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 35;
pub const _SC_REALTIME_SIGNALS: ::c_int = 36;
pub const _SC_SEMAPHORES: ::c_int = 37;
pub const _SC_FSYNC: ::c_int = 38;
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 39;
pub const _SC_SYNCHRONIZED_IO: ::c_int = 40;
pub const _SC_TIMERS: ::c_int = 41;
pub const _SC_AIO_LISTIO_MAX: ::c_int = 42;
pub const _SC_AIO_MAX: ::c_int = 43;
pub const _SC_AIO_PRIO_DELTA_MAX: ::c_int = 44;
pub const _SC_DELAYTIMER_MAX: ::c_int = 45;
pub const _SC_MQ_OPEN_MAX: ::c_int = 46;
pub const _SC_PAGESIZE: ::c_int = 47;
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_RTSIG_MAX: ::c_int = 48;
pub const _SC_SEM_NSEMS_MAX: ::c_int = 49;
pub const _SC_SEM_VALUE_MAX: ::c_int = 50;
pub const _SC_SIGQUEUE_MAX: ::c_int = 51;
pub const _SC_TIMER_MAX: ::c_int = 52;
pub const _SC_IOV_MAX: ::c_int = 56;
pub const _SC_NPROCESSORS_CONF: ::c_int = 57;
pub const _SC_2_PBS: ::c_int = 59;
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 60;
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 61;
pub const _SC_2_PBS_LOCATE: ::c_int = 62;
pub const _SC_2_PBS_MESSAGE: ::c_int = 63;
pub const _SC_2_PBS_TRACK: ::c_int = 64;
pub const _SC_ADVISORY_INFO: ::c_int = 65;
pub const _SC_BARRIERS: ::c_int = 66;
pub const _SC_CLOCK_SELECTION: ::c_int = 67;
pub const _SC_CPUTIME: ::c_int = 68;
pub const _SC_FILE_LOCKING: ::c_int = 69;
pub const _SC_NPROCESSORS_ONLN: ::c_int = 58;
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 70;
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 71;
pub const _SC_HOST_NAME_MAX: ::c_int = 72;
pub const _SC_LOGIN_NAME_MAX: ::c_int = 73;
pub const _SC_MONOTONIC_CLOCK: ::c_int = 74;
pub const _SC_MQ_PRIO_MAX: ::c_int = 75;
pub const _SC_READER_WRITER_LOCKS: ::c_int = 76;
pub const _SC_REGEXP: ::c_int = 77;
pub const _SC_SHELL: ::c_int = 78;
pub const _SC_SPAWN: ::c_int = 79;
pub const _SC_SPIN_LOCKS: ::c_int = 80;
pub const _SC_SPORADIC_SERVER: ::c_int = 81;
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 82;
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 83;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 85;
pub const _SC_THREAD_KEYS_MAX: ::c_int = 86;
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 87;
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 88;
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 89;
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 90;
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 91;
pub const _SC_THREAD_SPORADIC_SERVER: ::c_int = 92;
pub const _SC_THREAD_STACK_MIN: ::c_int = 93;
pub const _SC_THREAD_THREADS_MAX: ::c_int = 94;
pub const _SC_TIMEOUTS: ::c_int = 95;
pub const _SC_THREADS: ::c_int = 96;
pub const _SC_TRACE: ::c_int = 97;
pub const _SC_TRACE_EVENT_FILTER: ::c_int = 98;
pub const _SC_TRACE_INHERIT: ::c_int = 99;
pub const _SC_TRACE_LOG: ::c_int = 100;
pub const _SC_TTY_NAME_MAX: ::c_int = 101;
pub const _SC_TYPED_MEMORY_OBJECTS: ::c_int = 102;
pub const _SC_V6_ILP32_OFF32: ::c_int = 103;
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 104;
pub const _SC_V6_LP64_OFF64: ::c_int = 105;
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 106;
pub const _SC_ATEXIT_MAX: ::c_int = 107;
pub const _SC_XOPEN_CRYPT: ::c_int = 108;
pub const _SC_XOPEN_ENH_I18N: ::c_int = 109;
pub const _SC_XOPEN_LEGACY: ::c_int = 110;
pub const _SC_XOPEN_REALTIME: ::c_int = 111;
pub const _SC_XOPEN_REALTIME_THREADS: ::c_int = 112;
pub const _SC_XOPEN_SHM: ::c_int = 113;
pub const _SC_XOPEN_STREAMS: ::c_int = 114;
pub const _SC_XOPEN_UNIX: ::c_int = 115;
pub const _SC_XOPEN_VERSION: ::c_int = 116;
pub const _SC_XOPEN_XCU_VERSION: ::c_int = 117;
pub const _SC_IPV6: ::c_int = 118;
pub const _SC_RAW_SOCKETS: ::c_int = 119;
pub const _SC_SYMLOOP_MAX: ::c_int = 120;
pub const _SC_PHYS_PAGES: ::c_int = 121;
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _;
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _;
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_ERRORCHECK;
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_OTHER: ::c_int = 2;
pub const SCHED_RR: ::c_int = 3;
pub const FD_SETSIZE: usize = 1024;
pub const ST_NOSUID: ::c_ulong = 2;
pub const NI_MAXHOST: ::size_t = 1025;
pub const XUCRED_VERSION: ::c_uint = 0;
pub const RTLD_LOCAL: ::c_int = 0;
pub const RTLD_NODELETE: ::c_int = 0x1000;
pub const RTLD_NOLOAD: ::c_int = 0x2000;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const LOG_NTP: ::c_int = 12 << 3;
pub const LOG_SECURITY: ::c_int = 13 << 3;
pub const LOG_CONSOLE: ::c_int = 14 << 3;
pub const LOG_NFACILITIES: ::c_int = 24;
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
pub const TIOCGETA: ::c_ulong = 0x402c7413;
pub const TIOCSETA: ::c_ulong = 0x802c7414;
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
pub const TIOCDRAIN: ::c_ulong = 0x2000745e;
pub const TIOCEXT: ::c_ulong = 0x80047460;
pub const TIOCSCTTY: ::c_ulong = 0x20007461;
pub const TIOCCONS: ::c_ulong = 0x80047462;
pub const TIOCGSID: ::c_ulong = 0x40047463;
pub const TIOCSTAT: ::c_ulong = 0x20007465;
pub const TIOCUCNTL: ::c_ulong = 0x80047466;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCM_LE: ::c_int = 0x1;
pub const TIOCM_DTR: ::c_int = 0x2;
pub const TIOCM_RTS: ::c_int = 0x4;
pub const TIOCM_ST: ::c_int = 0x8;
pub const TIOCM_SR: ::c_int = 0x10;
pub const TIOCM_CTS: ::c_int = 0x20;
pub const TIOCM_RI: ::c_int = 0x80;
pub const TIOCM_DSR: ::c_int = 0x100;
pub const TIOCM_CD: ::c_int = 0x40;
pub const TIOCM_CAR: ::c_int = 0x40;
pub const TIOCM_RNG: ::c_int = 0x80;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
pub const TIOCSTART: ::c_ulong = 0x2000746e;
pub const TIOCSTOP: ::c_ulong = 0x2000746f;
pub const TIOCPKT: ::c_ulong = 0x80047470;
pub const TIOCPKT_DATA: ::c_int = 0x0;
pub const TIOCPKT_FLUSHREAD: ::c_int = 0x1;
pub const TIOCPKT_FLUSHWRITE: ::c_int = 0x2;
pub const TIOCPKT_STOP: ::c_int = 0x4;
pub const TIOCPKT_START: ::c_int = 0x8;
pub const TIOCPKT_NOSTOP: ::c_int = 0x10;
pub const TIOCPKT_DOSTOP: ::c_int = 0x20;
pub const TIOCPKT_IOCTL: ::c_int = 0x40;
pub const TIOCNOTTY: ::c_ulong = 0x20007471;
pub const TIOCSTI: ::c_ulong = 0x80017472;
pub const TIOCOUTQ: ::c_ulong = 0x40047473;
pub const TIOCSPGRP: ::c_ulong = 0x80047476;
pub const TIOCGPGRP: ::c_ulong = 0x40047477;
pub const TIOCCDTR: ::c_ulong = 0x20007478;
pub const TIOCSDTR: ::c_ulong = 0x20007479;
pub const TTYDISC: ::c_int = 0x0;
pub const SLIPDISC: ::c_int = 0x4;
pub const PPPDISC: ::c_int = 0x5;
pub const NETGRAPHDISC: ::c_int = 0x6;
pub const BIOCGRSIG: ::c_ulong = 0x40044272;
pub const BIOCSRSIG: ::c_ulong = 0x80044273;
pub const BIOCSDLT: ::c_ulong = 0x80044278;
pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
pub const BIOCSETF: ::c_ulong = 0x80104267;
pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const FIODTYPE: ::c_ulong = 0x4004667a;
pub const FIOGETLBA: ::c_ulong = 0x40046679;
pub const B0: speed_t = 0;
pub const B50: speed_t = 50;
pub const B75: speed_t = 75;
pub const B110: speed_t = 110;
pub const B134: speed_t = 134;
pub const B150: speed_t = 150;
pub const B200: speed_t = 200;
pub const B300: speed_t = 300;
pub const B600: speed_t = 600;
pub const B1200: speed_t = 1200;
pub const B1800: speed_t = 1800;
pub const B2400: speed_t = 2400;
pub const B4800: speed_t = 4800;
pub const B9600: speed_t = 9600;
pub const B19200: speed_t = 19200;
pub const B38400: speed_t = 38400;
pub const B7200: speed_t = 7200;
pub const B14400: speed_t = 14400;
pub const B28800: speed_t = 28800;
pub const B57600: speed_t = 57600;
pub const B76800: speed_t = 76800;
pub const B115200: speed_t = 115200;
pub const B230400: speed_t = 230400;
pub const EXTA: speed_t = 19200;
pub const EXTB: speed_t = 38400;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
pub const CRTSCTS: ::tcflag_t = 0x00030000;
pub const CCTS_OFLOW: ::tcflag_t = 0x00010000;
pub const CRTS_IFLOW: ::tcflag_t = 0x00020000;
pub const CDTR_IFLOW: ::tcflag_t = 0x00040000;
pub const CDSR_OFLOW: ::tcflag_t = 0x00080000;
pub const CCAR_OFLOW: ::tcflag_t = 0x00100000;
pub const VERASE2: usize = 7;
pub const OCRNL: ::tcflag_t = 0x10;
pub const ONOCR: ::tcflag_t = 0x20;
pub const ONLRET: ::tcflag_t = 0x40;
pub const CMGROUP_MAX: usize = 16;
pub const EUI64_LEN: usize = 8;
// https://github.com/freebsd/freebsd/blob/HEAD/sys/net/bpf.h
pub const BPF_ALIGNMENT: usize = SIZEOF_LONG;
// Values for rtprio struct (prio field) and syscall (function argument)
pub const RTP_PRIO_MIN: ::c_ushort = 0;
pub const RTP_PRIO_MAX: ::c_ushort = 31;
pub const RTP_LOOKUP: ::c_int = 0;
pub const RTP_SET: ::c_int = 1;
// Flags for chflags(2)
pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
pub const UF_NODUMP: ::c_ulong = 0x00000001;
pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
pub const UF_APPEND: ::c_ulong = 0x00000004;
pub const UF_OPAQUE: ::c_ulong = 0x00000008;
pub const UF_NOUNLINK: ::c_ulong = 0x00000010;
pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
pub const SF_APPEND: ::c_ulong = 0x00040000;
pub const SF_NOUNLINK: ::c_ulong = 0x00100000;
pub const TIMER_ABSTIME: ::c_int = 1;
//
pub const NTP_API: ::c_int = 4;
pub const MAXPHASE: ::c_long = 500000000;
pub const MAXFREQ: ::c_long = 500000;
pub const MINSEC: ::c_int = 256;
pub const MAXSEC: ::c_int = 2048;
pub const NANOSECOND: ::c_long = 1000000000;
pub const SCALE_PPM: ::c_int = 65;
pub const MAXTC: ::c_int = 10;
pub const MOD_OFFSET: ::c_uint = 0x0001;
pub const MOD_FREQUENCY: ::c_uint = 0x0002;
pub const MOD_MAXERROR: ::c_uint = 0x0004;
pub const MOD_ESTERROR: ::c_uint = 0x0008;
pub const MOD_STATUS: ::c_uint = 0x0010;
pub const MOD_TIMECONST: ::c_uint = 0x0020;
pub const MOD_PPSMAX: ::c_uint = 0x0040;
pub const MOD_TAI: ::c_uint = 0x0080;
pub const MOD_MICRO: ::c_uint = 0x1000;
pub const MOD_NANO: ::c_uint = 0x2000;
pub const MOD_CLKB: ::c_uint = 0x4000;
pub const MOD_CLKA: ::c_uint = 0x8000;
pub const STA_PLL: ::c_int = 0x0001;
pub const STA_PPSFREQ: ::c_int = 0x0002;
pub const STA_PPSTIME: ::c_int = 0x0004;
pub const STA_FLL: ::c_int = 0x0008;
pub const STA_INS: ::c_int = 0x0010;
pub const STA_DEL: ::c_int = 0x0020;
pub const STA_UNSYNC: ::c_int = 0x0040;
pub const STA_FREQHOLD: ::c_int = 0x0080;
pub const STA_PPSSIGNAL: ::c_int = 0x0100;
pub const STA_PPSJITTER: ::c_int = 0x0200;
pub const STA_PPSWANDER: ::c_int = 0x0400;
pub const STA_PPSERROR: ::c_int = 0x0800;
pub const STA_CLOCKERR: ::c_int = 0x1000;
pub const STA_NANO: ::c_int = 0x2000;
pub const STA_MODE: ::c_int = 0x4000;
pub const STA_CLK: ::c_int = 0x8000;
pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
| STA_PPSJITTER
| STA_PPSWANDER
| STA_PPSERROR
| STA_CLOCKERR
| STA_NANO
| STA_MODE
| STA_CLK;
pub const TIME_OK: ::c_int = 0;
pub const TIME_INS: ::c_int = 1;
pub const TIME_DEL: ::c_int = 2;
pub const TIME_OOP: ::c_int = 3;
pub const TIME_WAIT: ::c_int = 4;
pub const TIME_ERROR: ::c_int = 5;
pub const REG_ENOSYS: ::c_int = -1;
pub const REG_ILLSEQ: ::c_int = 17;
pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_CREAT: ::c_int = 0o1000;
pub const IPC_EXCL: ::c_int = 0o2000;
pub const IPC_NOWAIT: ::c_int = 0o4000;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_R: ::c_int = 0o400;
pub const IPC_W: ::c_int = 0o200;
pub const IPC_M: ::c_int = 0o10000;
pub const SHM_RDONLY: ::c_int = 0o10000;
pub const SHM_RND: ::c_int = 0o20000;
pub const SHM_R: ::c_int = 0o400;
pub const SHM_W: ::c_int = 0o200;
pub const KENV_GET: ::c_int = 0;
pub const KENV_SET: ::c_int = 1;
pub const KENV_UNSET: ::c_int = 2;
pub const KENV_DUMP: ::c_int = 3;
pub const KENV_MNAMELEN: ::c_int = 128;
pub const KENV_MVALLEN: ::c_int = 128;
pub const RB_ASKNAME: ::c_int = 0x001;
pub const RB_SINGLE: ::c_int = 0x002;
pub const RB_NOSYNC: ::c_int = 0x004;
pub const RB_HALT: ::c_int = 0x008;
pub const RB_INITNAME: ::c_int = 0x010;
pub const RB_DFLTROOT: ::c_int = 0x020;
pub const RB_KDB: ::c_int = 0x040;
pub const RB_RDONLY: ::c_int = 0x080;
pub const RB_DUMP: ::c_int = 0x100;
pub const RB_MINIROOT: ::c_int = 0x200;
pub const RB_VERBOSE: ::c_int = 0x800;
pub const RB_SERIAL: ::c_int = 0x1000;
pub const RB_CDROM: ::c_int = 0x2000;
pub const RB_POWEROFF: ::c_int = 0x4000;
pub const RB_GDB: ::c_int = 0x8000;
pub const RB_MUTE: ::c_int = 0x10000;
pub const RB_SELFTEST: ::c_int = 0x20000;
safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
}
pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
status >> 8
}
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0o177) == 0o177
}
}
extern "C" {
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::timezone) -> ::c_int;
pub fn accept4(
s: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn chflagsat(
fd: ::c_int,
path: *const ::c_char,
flags: ::c_ulong,
atflag: ::c_int,
) -> ::c_int;
pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn clock_getcpuclockid(pid: ::pid_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn pthread_getcpuclockid(thread: ::pthread_t, clk_id: *mut ::clockid_t) -> ::c_int;
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn endutxent();
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn fexecve(
fd: ::c_int,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::c_int) -> ::c_int;
pub fn getgrent_r(
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn getpwent_r(
pwd: *mut ::passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::passwd,
) -> ::c_int;
pub fn getgrouplist(
name: *const ::c_char,
basegid: ::gid_t,
groups: *mut ::gid_t,
ngroups: *mut ::c_int,
) -> ::c_int;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
host: *mut ::c_char,
hostlen: ::size_t,
serv: *mut ::c_char,
servlen: ::size_t,
flags: ::c_int,
) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::c_int) -> ::c_int;
pub fn getresgid(rgid: *mut ::gid_t, egid: *mut ::gid_t, sgid: *mut ::gid_t) -> ::c_int;
pub fn getresuid(ruid: *mut ::uid_t, euid: *mut ::uid_t, suid: *mut ::uid_t) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "kevent@FBSD_1.0"
)]
pub fn kevent(
kq: ::c_int,
changelist: *const ::kevent,
nchanges: ::c_int,
eventlist: *mut ::kevent,
nevents: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "mknodat@FBSD_1.1"
)]
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn malloc_usable_size(ptr: *const ::c_void) -> ::size_t;
pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn posix_fallocate(fd: ::c_int, offset: ::off_t, len: ::off_t) -> ::c_int;
pub fn posix_fadvise(fd: ::c_int, offset: ::off_t, len: ::off_t, advise: ::c_int) -> ::c_int;
pub fn ppoll(
fds: *mut ::pollfd,
nfds: ::nfds_t,
timeout: *const ::timespec,
sigmask: *const sigset_t,
) -> ::c_int;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn pthread_attr_get_np(tid: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_condattr_getclock(
attr: *const pthread_condattr_t,
clock_id: *mut clockid_t,
) -> ::c_int;
pub fn pthread_condattr_getpshared(
attr: *const pthread_condattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_main_np() -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_mutexattr_getpshared(
attr: *const pthread_mutexattr_t,
pshared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setpshared(
attr: *mut pthread_mutexattr_t,
pshared: ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_getpshared(
attr: *const pthread_rwlockattr_t,
val: *mut ::c_int,
) -> ::c_int;
pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: ::c_int) -> ::c_int;
pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
pub fn pthread_barrierattr_getpshared(
attr: *const ::pthread_barrierattr_t,
shared: *mut ::c_int,
) -> ::c_int;
pub fn pthread_barrierattr_setpshared(
attr: *mut ::pthread_barrierattr_t,
shared: ::c_int,
) -> ::c_int;
pub fn pthread_barrier_init(
barrier: *mut pthread_barrier_t,
attr: *const ::pthread_barrierattr_t,
count: ::c_uint,
) -> ::c_int;
pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
pub fn pthread_get_name_np(tid: ::pthread_t, name: *mut ::c_char, len: ::size_t);
pub fn pthread_set_name_np(tid: ::pthread_t, name: *const ::c_char);
pub fn pthread_getname_np(
thread: ::pthread_t,
buffer: *mut ::c_char,
length: ::size_t,
) -> ::c_int;
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
pub fn pthread_setschedparam(
native: ::pthread_t,
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
param: *mut sched_param,
) -> ::c_int;
pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_char, data: ::c_int) -> ::c_int;
pub fn utrace(addr: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
pub fn querylocale(mask: ::c_int, loc: ::locale_t) -> *const ::c_char;
pub fn rtprio(function: ::c_int, pid: ::pid_t, rtp: *mut rtprio) -> ::c_int;
pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
pub fn sched_getparam(pid: ::pid_t, param: *mut sched_param) -> ::c_int;
pub fn sched_setparam(pid: ::pid_t, param: *const sched_param) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,
policy: ::c_int,
param: *const ::sched_param,
) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sendfile(
fd: ::c_int,
s: ::c_int,
offset: ::off_t,
nbytes: ::size_t,
hdtr: *mut ::sf_hdtr,
sbytes: *mut ::off_t,
flags: ::c_int,
) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::c_int) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::c_int, prio: ::c_int) -> ::c_int;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
pub fn settimeofday(tv: *const ::timeval, tz: *const ::timezone) -> ::c_int;
pub fn setutxent();
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
pub fn sysctl(
name: *const ::c_int,
namelen: ::c_uint,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *const ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn sysctlbyname(
name: *const ::c_char,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *const ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn sysctlnametomib(
name: *const ::c_char,
mibp: *mut ::c_int,
sizep: *mut ::size_t,
) -> ::c_int;
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
// #include
pub fn dl_iterate_phdr(
callback: ::Option<
unsafe extern "C" fn(
info: *mut dl_phdr_info,
size: usize,
data: *mut ::c_void,
) -> ::c_int,
>,
data: *mut ::c_void,
) -> ::c_int;
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
inbytesleft: *mut ::size_t,
outbuf: *mut *mut ::c_char,
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
// Added in `FreeBSD` 11.0
// Added in `DragonFly BSD` 5.4
pub fn explicit_bzero(s: *mut ::c_void, len: ::size_t);
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
pub fn gethostid() -> ::c_long;
pub fn sethostid(hostid: ::c_long);
pub fn eui64_aton(a: *const ::c_char, e: *mut eui64) -> ::c_int;
pub fn eui64_ntoa(id: *const eui64, a: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn eui64_ntohost(hostname: *mut ::c_char, len: ::size_t, id: *const eui64) -> ::c_int;
pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int;
pub fn eaccess(path: *const ::c_char, mode: ::c_int) -> ::c_int;
pub fn kenv(
action: ::c_int,
name: *const ::c_char,
value: *mut ::c_char,
len: ::c_int,
) -> ::c_int;
pub fn reboot(howto: ::c_int) -> ::c_int;
pub fn exect(
path: *const ::c_char,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn execvP(
file: *const ::c_char,
search_path: *const ::c_char,
argv: *const *mut ::c_char,
) -> ::c_int;
}
#[link(name = "rt")]
extern "C" {
pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
pub fn mq_receive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
) -> ::ssize_t;
pub fn mq_send(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
) -> ::c_int;
pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
pub fn mq_timedreceive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
abs_timeout: *const ::timespec,
) -> ::ssize_t;
pub fn mq_timedsend(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
}
#[link(name = "util")]
extern "C" {
pub fn openpty(
amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
) -> ::c_int;
pub fn forkpty(
amaster: *mut ::c_int,
name: *mut ::c_char,
termp: *mut termios,
winp: *mut ::winsize,
) -> ::pid_t;
pub fn login_tty(fd: ::c_int) -> ::c_int;
pub fn fparseln(
stream: *mut ::FILE,
len: *mut ::size_t,
lineno: *mut ::size_t,
delim: *const ::c_char,
flags: ::c_int,
) -> *mut ::c_char;
}
#[link(name = "execinfo")]
extern "C" {
pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
pub fn backtrace_symbols_fd(
addrlist: *const *mut ::c_void,
len: ::size_t,
fd: ::c_int,
) -> ::c_int;
}
#[link(name = "kvm")]
extern "C" {
pub fn kvm_open(
execfile: *const ::c_char,
corefile: *const ::c_char,
swapfile: *const ::c_char,
flags: ::c_int,
errstr: *const ::c_char,
) -> *mut ::kvm_t;
pub fn kvm_close(kd: *mut ::kvm_t) -> ::c_int;
pub fn kvm_getprocs(
kd: *mut ::kvm_t,
op: ::c_int,
arg: ::c_int,
cnt: *mut ::c_int,
) -> *mut ::kinfo_proc;
pub fn kvm_getloadavg(kd: *mut kvm_t, loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
pub fn kvm_openfiles(
execfile: *const ::c_char,
corefile: *const ::c_char,
swapfile: *const ::c_char,
flags: ::c_int,
errbuf: *mut ::c_char,
) -> *mut ::kvm_t;
pub fn kvm_read(
kd: *mut ::kvm_t,
addr: ::c_ulong,
buf: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn kvm_write(
kd: *mut ::kvm_t,
addr: ::c_ulong,
buf: *const ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
}
cfg_if! {
if #[cfg(target_os = "freebsd")] {
mod freebsd;
pub use self::freebsd::*;
} else if #[cfg(target_os = "dragonfly")] {
mod dragonfly;
pub use self::dragonfly::*;
} else {
// ...
}
}
libc-0.2.152/src/unix/bsd/mod.rs 0000644 0000000 0000000 00000073203 10461020230 0014360 0 ustar 0000000 0000000 pub type off_t = i64;
pub type useconds_t = u32;
pub type blkcnt_t = i64;
pub type socklen_t = u32;
pub type sa_family_t = u8;
pub type pthread_t = ::uintptr_t;
pub type nfds_t = ::c_uint;
pub type regoff_t = off_t;
s! {
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [::c_char; 14],
}
pub struct sockaddr_in6 {
pub sin6_len: u8,
pub sin6_family: sa_family_t,
pub sin6_port: ::in_port_t,
pub sin6_flowinfo: u32,
pub sin6_addr: ::in6_addr,
pub sin6_scope_id: u32,
}
pub struct passwd {
pub pw_name: *mut ::c_char,
pub pw_passwd: *mut ::c_char,
pub pw_uid: ::uid_t,
pub pw_gid: ::gid_t,
pub pw_change: ::time_t,
pub pw_class: *mut ::c_char,
pub pw_gecos: *mut ::c_char,
pub pw_dir: *mut ::c_char,
pub pw_shell: *mut ::c_char,
pub pw_expire: ::time_t,
#[cfg(not(any(target_os = "macos",
target_os = "ios",
target_os = "tvos",
target_os = "watchos",
target_os = "netbsd",
target_os = "openbsd")))]
pub pw_fields: ::c_int,
}
pub struct ifaddrs {
pub ifa_next: *mut ifaddrs,
pub ifa_name: *mut ::c_char,
pub ifa_flags: ::c_uint,
pub ifa_addr: *mut ::sockaddr,
pub ifa_netmask: *mut ::sockaddr,
pub ifa_dstaddr: *mut ::sockaddr,
pub ifa_data: *mut ::c_void,
#[cfg(target_os = "netbsd")]
pub ifa_addrflags: ::c_uint
}
pub struct fd_set {
#[cfg(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly")))]
fds_bits: [i64; FD_SETSIZE / 64],
#[cfg(not(all(target_pointer_width = "64",
any(target_os = "freebsd", target_os = "dragonfly"))))]
fds_bits: [i32; FD_SETSIZE / 32],
}
pub struct tm {
pub tm_sec: ::c_int,
pub tm_min: ::c_int,
pub tm_hour: ::c_int,
pub tm_mday: ::c_int,
pub tm_mon: ::c_int,
pub tm_year: ::c_int,
pub tm_wday: ::c_int,
pub tm_yday: ::c_int,
pub tm_isdst: ::c_int,
pub tm_gmtoff: ::c_long,
pub tm_zone: *mut ::c_char,
}
pub struct msghdr {
pub msg_name: *mut ::c_void,
pub msg_namelen: ::socklen_t,
pub msg_iov: *mut ::iovec,
pub msg_iovlen: ::c_int,
pub msg_control: *mut ::c_void,
pub msg_controllen: ::socklen_t,
pub msg_flags: ::c_int,
}
pub struct cmsghdr {
pub cmsg_len: ::socklen_t,
pub cmsg_level: ::c_int,
pub cmsg_type: ::c_int,
}
pub struct fsid_t {
__fsid_val: [i32; 2],
}
pub struct if_nameindex {
pub if_index: ::c_uint,
pub if_name: *mut ::c_char,
}
pub struct regex_t {
__re_magic: ::c_int,
__re_nsub: ::size_t,
__re_endp: *const ::c_char,
__re_g: *mut ::c_void,
}
pub struct regmatch_t {
pub rm_so: regoff_t,
pub rm_eo: regoff_t,
}
pub struct option {
pub name: *const ::c_char,
pub has_arg: ::c_int,
pub flag: *mut ::c_int,
pub val: ::c_int,
}
}
s_no_extra_traits! {
pub struct sockaddr_un {
pub sun_len: u8,
pub sun_family: sa_family_t,
pub sun_path: [c_char; 104]
}
pub struct utsname {
#[cfg(not(target_os = "dragonfly"))]
pub sysname: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub sysname: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub nodename: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub nodename: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub release: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub release: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub version: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub version: [::c_char; 32],
#[cfg(not(target_os = "dragonfly"))]
pub machine: [::c_char; 256],
#[cfg(target_os = "dragonfly")]
pub machine: [::c_char; 32],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for sockaddr_un {
fn eq(&self, other: &sockaddr_un) -> bool {
self.sun_len == other.sun_len
&& self.sun_family == other.sun_family
&& self
.sun_path
.iter()
.zip(other.sun_path.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sockaddr_un {}
impl ::fmt::Debug for sockaddr_un {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_un")
.field("sun_len", &self.sun_len)
.field("sun_family", &self.sun_family)
// FIXME: .field("sun_path", &self.sun_path)
.finish()
}
}
impl ::hash::Hash for sockaddr_un {
fn hash(&self, state: &mut H) {
self.sun_len.hash(state);
self.sun_family.hash(state);
self.sun_path.hash(state);
}
}
impl PartialEq for utsname {
fn eq(&self, other: &utsname) -> bool {
self.sysname
.iter()
.zip(other.sysname.iter())
.all(|(a,b)| a == b)
&& self
.nodename
.iter()
.zip(other.nodename.iter())
.all(|(a,b)| a == b)
&& self
.release
.iter()
.zip(other.release.iter())
.all(|(a,b)| a == b)
&& self
.version
.iter()
.zip(other.version.iter())
.all(|(a,b)| a == b)
&& self
.machine
.iter()
.zip(other.machine.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for utsname {}
impl ::fmt::Debug for utsname {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utsname")
// FIXME: .field("sysname", &self.sysname)
// FIXME: .field("nodename", &self.nodename)
// FIXME: .field("release", &self.release)
// FIXME: .field("version", &self.version)
// FIXME: .field("machine", &self.machine)
.finish()
}
}
impl ::hash::Hash for utsname {
fn hash(&self, state: &mut H) {
self.sysname.hash(state);
self.nodename.hash(state);
self.release.hash(state);
self.version.hash(state);
self.machine.hash(state);
}
}
}
}
pub const LC_ALL: ::c_int = 0;
pub const LC_COLLATE: ::c_int = 1;
pub const LC_CTYPE: ::c_int = 2;
pub const LC_MONETARY: ::c_int = 3;
pub const LC_NUMERIC: ::c_int = 4;
pub const LC_TIME: ::c_int = 5;
pub const LC_MESSAGES: ::c_int = 6;
pub const FIOCLEX: ::c_ulong = 0x20006601;
pub const FIONCLEX: ::c_ulong = 0x20006602;
pub const FIONREAD: ::c_ulong = 0x4004667f;
pub const FIONBIO: ::c_ulong = 0x8004667e;
pub const FIOASYNC: ::c_ulong = 0x8004667d;
pub const FIOSETOWN: ::c_ulong = 0x8004667c;
pub const FIOGETOWN: ::c_ulong = 0x4004667b;
pub const PATH_MAX: ::c_int = 1024;
pub const MAXPATHLEN: ::c_int = PATH_MAX;
pub const IOV_MAX: ::c_int = 1024;
pub const SA_ONSTACK: ::c_int = 0x0001;
pub const SA_SIGINFO: ::c_int = 0x0040;
pub const SA_RESTART: ::c_int = 0x0002;
pub const SA_RESETHAND: ::c_int = 0x0004;
pub const SA_NOCLDSTOP: ::c_int = 0x0008;
pub const SA_NODEFER: ::c_int = 0x0010;
pub const SA_NOCLDWAIT: ::c_int = 0x0020;
pub const SS_ONSTACK: ::c_int = 1;
pub const SS_DISABLE: ::c_int = 4;
pub const SIGCHLD: ::c_int = 20;
pub const SIGBUS: ::c_int = 10;
pub const SIGUSR1: ::c_int = 30;
pub const SIGUSR2: ::c_int = 31;
pub const SIGCONT: ::c_int = 19;
pub const SIGSTOP: ::c_int = 17;
pub const SIGTSTP: ::c_int = 18;
pub const SIGURG: ::c_int = 16;
pub const SIGIO: ::c_int = 23;
pub const SIGSYS: ::c_int = 12;
pub const SIGTTIN: ::c_int = 21;
pub const SIGTTOU: ::c_int = 22;
pub const SIGXCPU: ::c_int = 24;
pub const SIGXFSZ: ::c_int = 25;
pub const SIGVTALRM: ::c_int = 26;
pub const SIGPROF: ::c_int = 27;
pub const SIGWINCH: ::c_int = 28;
pub const SIGINFO: ::c_int = 29;
pub const SIG_SETMASK: ::c_int = 3;
pub const SIG_BLOCK: ::c_int = 0x1;
pub const SIG_UNBLOCK: ::c_int = 0x2;
pub const IP_TOS: ::c_int = 3;
pub const IP_MULTICAST_IF: ::c_int = 9;
pub const IP_MULTICAST_TTL: ::c_int = 10;
pub const IP_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_UNICAST_HOPS: ::c_int = 4;
pub const IPV6_MULTICAST_IF: ::c_int = 9;
pub const IPV6_MULTICAST_HOPS: ::c_int = 10;
pub const IPV6_MULTICAST_LOOP: ::c_int = 11;
pub const IPV6_V6ONLY: ::c_int = 27;
pub const IPTOS_ECN_NOTECT: u8 = 0x00;
pub const IPTOS_ECN_MASK: u8 = 0x03;
pub const IPTOS_ECN_ECT1: u8 = 0x01;
pub const IPTOS_ECN_ECT0: u8 = 0x02;
pub const IPTOS_ECN_CE: u8 = 0x03;
pub const ST_RDONLY: ::c_ulong = 1;
pub const SCM_RIGHTS: ::c_int = 0x01;
pub const NCCS: usize = 20;
pub const O_ACCMODE: ::c_int = 0x3;
pub const O_RDONLY: ::c_int = 0;
pub const O_WRONLY: ::c_int = 1;
pub const O_RDWR: ::c_int = 2;
pub const O_APPEND: ::c_int = 8;
pub const O_CREAT: ::c_int = 512;
pub const O_TRUNC: ::c_int = 1024;
pub const O_EXCL: ::c_int = 2048;
pub const O_ASYNC: ::c_int = 0x40;
pub const O_SYNC: ::c_int = 0x80;
pub const O_NONBLOCK: ::c_int = 0x4;
pub const O_NOFOLLOW: ::c_int = 0x100;
pub const O_SHLOCK: ::c_int = 0x10;
pub const O_EXLOCK: ::c_int = 0x20;
pub const O_FSYNC: ::c_int = O_SYNC;
pub const O_NDELAY: ::c_int = O_NONBLOCK;
pub const F_GETOWN: ::c_int = 5;
pub const F_SETOWN: ::c_int = 6;
pub const F_RDLCK: ::c_short = 1;
pub const F_UNLCK: ::c_short = 2;
pub const F_WRLCK: ::c_short = 3;
pub const MNT_RDONLY: ::c_int = 0x00000001;
pub const MNT_SYNCHRONOUS: ::c_int = 0x00000002;
pub const MNT_NOEXEC: ::c_int = 0x00000004;
pub const MNT_NOSUID: ::c_int = 0x00000008;
pub const MNT_ASYNC: ::c_int = 0x00000040;
pub const MNT_EXPORTED: ::c_int = 0x00000100;
pub const MNT_UPDATE: ::c_int = 0x00010000;
pub const MNT_RELOAD: ::c_int = 0x00040000;
pub const MNT_FORCE: ::c_int = 0x00080000;
pub const Q_SYNC: ::c_int = 0x600;
pub const Q_QUOTAON: ::c_int = 0x100;
pub const Q_QUOTAOFF: ::c_int = 0x200;
pub const TCIOFF: ::c_int = 3;
pub const TCION: ::c_int = 4;
pub const TCOOFF: ::c_int = 1;
pub const TCOON: ::c_int = 2;
pub const TCIFLUSH: ::c_int = 1;
pub const TCOFLUSH: ::c_int = 2;
pub const TCIOFLUSH: ::c_int = 3;
pub const TCSANOW: ::c_int = 0;
pub const TCSADRAIN: ::c_int = 1;
pub const TCSAFLUSH: ::c_int = 2;
pub const VEOF: usize = 0;
pub const VEOL: usize = 1;
pub const VEOL2: usize = 2;
pub const VERASE: usize = 3;
pub const VWERASE: usize = 4;
pub const VKILL: usize = 5;
pub const VREPRINT: usize = 6;
pub const VINTR: usize = 8;
pub const VQUIT: usize = 9;
pub const VSUSP: usize = 10;
pub const VDSUSP: usize = 11;
pub const VSTART: usize = 12;
pub const VSTOP: usize = 13;
pub const VLNEXT: usize = 14;
pub const VDISCARD: usize = 15;
pub const VMIN: usize = 16;
pub const VTIME: usize = 17;
pub const VSTATUS: usize = 18;
pub const _POSIX_VDISABLE: ::cc_t = 0xff;
pub const IGNBRK: ::tcflag_t = 0x00000001;
pub const BRKINT: ::tcflag_t = 0x00000002;
pub const IGNPAR: ::tcflag_t = 0x00000004;
pub const PARMRK: ::tcflag_t = 0x00000008;
pub const INPCK: ::tcflag_t = 0x00000010;
pub const ISTRIP: ::tcflag_t = 0x00000020;
pub const INLCR: ::tcflag_t = 0x00000040;
pub const IGNCR: ::tcflag_t = 0x00000080;
pub const ICRNL: ::tcflag_t = 0x00000100;
pub const IXON: ::tcflag_t = 0x00000200;
pub const IXOFF: ::tcflag_t = 0x00000400;
pub const IXANY: ::tcflag_t = 0x00000800;
pub const IMAXBEL: ::tcflag_t = 0x00002000;
pub const OPOST: ::tcflag_t = 0x1;
pub const ONLCR: ::tcflag_t = 0x2;
pub const OXTABS: ::tcflag_t = 0x4;
pub const ONOEOT: ::tcflag_t = 0x8;
pub const CIGNORE: ::tcflag_t = 0x00000001;
pub const CSIZE: ::tcflag_t = 0x00000300;
pub const CS5: ::tcflag_t = 0x00000000;
pub const CS6: ::tcflag_t = 0x00000100;
pub const CS7: ::tcflag_t = 0x00000200;
pub const CS8: ::tcflag_t = 0x00000300;
pub const CSTOPB: ::tcflag_t = 0x00000400;
pub const CREAD: ::tcflag_t = 0x00000800;
pub const PARENB: ::tcflag_t = 0x00001000;
pub const PARODD: ::tcflag_t = 0x00002000;
pub const HUPCL: ::tcflag_t = 0x00004000;
pub const CLOCAL: ::tcflag_t = 0x00008000;
pub const ECHOKE: ::tcflag_t = 0x00000001;
pub const ECHOE: ::tcflag_t = 0x00000002;
pub const ECHOK: ::tcflag_t = 0x00000004;
pub const ECHO: ::tcflag_t = 0x00000008;
pub const ECHONL: ::tcflag_t = 0x00000010;
pub const ECHOPRT: ::tcflag_t = 0x00000020;
pub const ECHOCTL: ::tcflag_t = 0x00000040;
pub const ISIG: ::tcflag_t = 0x00000080;
pub const ICANON: ::tcflag_t = 0x00000100;
pub const ALTWERASE: ::tcflag_t = 0x00000200;
pub const IEXTEN: ::tcflag_t = 0x00000400;
pub const EXTPROC: ::tcflag_t = 0x00000800;
pub const TOSTOP: ::tcflag_t = 0x00400000;
pub const FLUSHO: ::tcflag_t = 0x00800000;
pub const NOKERNINFO: ::tcflag_t = 0x02000000;
pub const PENDIN: ::tcflag_t = 0x20000000;
pub const NOFLSH: ::tcflag_t = 0x80000000;
pub const MDMBUF: ::tcflag_t = 0x00100000;
pub const WNOHANG: ::c_int = 0x00000001;
pub const WUNTRACED: ::c_int = 0x00000002;
pub const RTLD_LAZY: ::c_int = 0x1;
pub const RTLD_NOW: ::c_int = 0x2;
pub const RTLD_NEXT: *mut ::c_void = -1isize as *mut ::c_void;
pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
pub const RTLD_SELF: *mut ::c_void = -3isize as *mut ::c_void;
pub const LOG_CRON: ::c_int = 9 << 3;
pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_FTP: ::c_int = 11 << 3;
pub const LOG_PERROR: ::c_int = 0x20;
pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const PIPE_BUF: usize = 512;
// si_code values for SIGBUS signal
pub const BUS_ADRALN: ::c_int = 1;
pub const BUS_ADRERR: ::c_int = 2;
pub const BUS_OBJERR: ::c_int = 3;
// si_code values for SIGCHLD signal
pub const CLD_EXITED: ::c_int = 1;
pub const CLD_KILLED: ::c_int = 2;
pub const CLD_DUMPED: ::c_int = 3;
pub const CLD_TRAPPED: ::c_int = 4;
pub const CLD_STOPPED: ::c_int = 5;
pub const CLD_CONTINUED: ::c_int = 6;
pub const POLLIN: ::c_short = 0x1;
pub const POLLPRI: ::c_short = 0x2;
pub const POLLOUT: ::c_short = 0x4;
pub const POLLERR: ::c_short = 0x8;
pub const POLLHUP: ::c_short = 0x10;
pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLWRNORM: ::c_short = 0x004;
pub const POLLRDBAND: ::c_short = 0x080;
pub const POLLWRBAND: ::c_short = 0x100;
pub const BIOCGBLEN: ::c_ulong = 0x40044266;
pub const BIOCSBLEN: ::c_ulong = 0xc0044266;
pub const BIOCFLUSH: ::c_uint = 0x20004268;
pub const BIOCPROMISC: ::c_uint = 0x20004269;
pub const BIOCGDLT: ::c_ulong = 0x4004426a;
pub const BIOCGETIF: ::c_ulong = 0x4020426b;
pub const BIOCSETIF: ::c_ulong = 0x8020426c;
pub const BIOCGSTATS: ::c_ulong = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270;
pub const BIOCVERSION: ::c_ulong = 0x40044271;
pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274;
pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275;
pub const SIOCGIFADDR: ::c_ulong = 0xc0206921;
pub const REG_BASIC: ::c_int = 0o0000;
pub const REG_EXTENDED: ::c_int = 0o0001;
pub const REG_ICASE: ::c_int = 0o0002;
pub const REG_NOSUB: ::c_int = 0o0004;
pub const REG_NEWLINE: ::c_int = 0o0010;
pub const REG_NOSPEC: ::c_int = 0o0020;
pub const REG_PEND: ::c_int = 0o0040;
pub const REG_DUMP: ::c_int = 0o0200;
pub const REG_NOMATCH: ::c_int = 1;
pub const REG_BADPAT: ::c_int = 2;
pub const REG_ECOLLATE: ::c_int = 3;
pub const REG_ECTYPE: ::c_int = 4;
pub const REG_EESCAPE: ::c_int = 5;
pub const REG_ESUBREG: ::c_int = 6;
pub const REG_EBRACK: ::c_int = 7;
pub const REG_EPAREN: ::c_int = 8;
pub const REG_EBRACE: ::c_int = 9;
pub const REG_BADBR: ::c_int = 10;
pub const REG_ERANGE: ::c_int = 11;
pub const REG_ESPACE: ::c_int = 12;
pub const REG_BADRPT: ::c_int = 13;
pub const REG_EMPTY: ::c_int = 14;
pub const REG_ASSERT: ::c_int = 15;
pub const REG_INVARG: ::c_int = 16;
pub const REG_ATOI: ::c_int = 255;
pub const REG_ITOA: ::c_int = 0o0400;
pub const REG_NOTBOL: ::c_int = 0o00001;
pub const REG_NOTEOL: ::c_int = 0o00002;
pub const REG_STARTEND: ::c_int = 0o00004;
pub const REG_TRACE: ::c_int = 0o00400;
pub const REG_LARGE: ::c_int = 0o01000;
pub const REG_BACKR: ::c_int = 0o02000;
pub const TIOCCBRK: ::c_uint = 0x2000747a;
pub const TIOCSBRK: ::c_uint = 0x2000747b;
pub const PRIO_PROCESS: ::c_int = 0;
pub const PRIO_PGRP: ::c_int = 1;
pub const PRIO_USER: ::c_int = 2;
pub const ITIMER_REAL: ::c_int = 0;
pub const ITIMER_VIRTUAL: ::c_int = 1;
pub const ITIMER_PROF: ::c_int = 2;
f! {
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {
(*mhdr).msg_control as *mut ::cmsghdr
} else {
0 as *mut ::cmsghdr
}
}
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] &= !(1 << (fd % bits));
return
}
pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0
}
pub fn FD_SET(fd: ::c_int, set: *mut fd_set) -> () {
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;
let fd = fd as usize;
(*set).fds_bits[fd / bits] |= 1 << (fd % bits);
return
}
pub fn FD_ZERO(set: *mut fd_set) -> () {
for slot in (*set).fds_bits.iter_mut() {
*slot = 0;
}
}
}
safe_f! {
pub {const} fn WTERMSIG(status: ::c_int) -> ::c_int {
status & 0o177
}
pub {const} fn WIFEXITED(status: ::c_int) -> bool {
(status & 0o177) == 0
}
pub {const} fn WEXITSTATUS(status: ::c_int) -> ::c_int {
status >> 8
}
pub {const} fn WCOREDUMP(status: ::c_int) -> bool {
(status & 0o200) != 0
}
pub {const} fn QCMD(cmd: ::c_int, type_: ::c_int) -> ::c_int {
(cmd << 8) | (type_ & 0x00ff)
}
}
extern "C" {
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getrlimit$UNIX2003"
)]
pub fn getrlimit(resource: ::c_int, rlim: *mut ::rlimit) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setrlimit$UNIX2003"
)]
pub fn setrlimit(resource: ::c_int, rlim: *const ::rlimit) -> ::c_int;
pub fn strerror_r(errnum: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;
pub fn abs(i: ::c_int) -> ::c_int;
pub fn labs(i: ::c_long) -> ::c_long;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "rand@FBSD_1.0"
)]
pub fn rand() -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "srand@FBSD_1.0"
)]
pub fn srand(seed: ::c_uint);
pub fn getifaddrs(ifap: *mut *mut ::ifaddrs) -> ::c_int;
pub fn freeifaddrs(ifa: *mut ::ifaddrs);
pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
pub fn setlogin(name: *const ::c_char) -> ::c_int;
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn kqueue() -> ::c_int;
pub fn unmount(target: *const ::c_char, arg: ::c_int) -> ::c_int;
pub fn syscall(num: ::c_int, ...) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")]
pub fn getpwent() -> *mut passwd;
pub fn setpwent();
pub fn endpwent();
pub fn endgrent();
pub fn getgrent() -> *mut ::group;
pub fn getprogname() -> *const ::c_char;
pub fn setprogname(name: *const ::c_char);
pub fn getloadavg(loadavg: *mut ::c_double, nelem: ::c_int) -> ::c_int;
pub fn if_nameindex() -> *mut if_nameindex;
pub fn if_freenameindex(ptr: *mut if_nameindex);
pub fn getpeereid(socket: ::c_int, euid: *mut ::uid_t, egid: *mut ::gid_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", not(target_arch = "aarch64")),
link_name = "glob$INODE64"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__glob30")]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "glob@FBSD_1.0"
)]
pub fn glob(
pattern: *const ::c_char,
flags: ::c_int,
errfunc: ::Option ::c_int>,
pglob: *mut ::glob_t,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__globfree30")]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd11, freebsd10)),
link_name = "globfree@FBSD_1.0"
)]
pub fn globfree(pglob: *mut ::glob_t);
pub fn posix_madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
pub fn shm_unlink(name: *const ::c_char) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "seekdir$INODE64"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "seekdir$INODE64$UNIX2003"
)]
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
#[cfg_attr(
all(target_os = "macos", target_arch = "x86_64"),
link_name = "telldir$INODE64"
)]
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "telldir$INODE64$UNIX2003"
)]
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "msync$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__msync13")]
pub fn msync(addr: *mut ::c_void, len: ::size_t, flags: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recvfrom$UNIX2003"
)]
pub fn recvfrom(
socket: ::c_int,
buf: *mut ::c_void,
len: ::size_t,
flags: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
) -> ::ssize_t;
pub fn mkstemps(template: *mut ::c_char, suffixlen: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__futimes50")]
pub fn futimes(fd: ::c_int, times: *const ::timeval) -> ::c_int;
pub fn nl_langinfo(item: ::nl_item) -> *mut ::c_char;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "bind$UNIX2003"
)]
pub fn bind(socket: ::c_int, address: *const ::sockaddr, address_len: ::socklen_t) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "writev$UNIX2003"
)]
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "readv$UNIX2003"
)]
pub fn readv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sendmsg$UNIX2003"
)]
pub fn sendmsg(fd: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "recvmsg$UNIX2003"
)]
pub fn recvmsg(fd: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
pub fn sync();
pub fn getgrgid_r(
gid: ::gid_t,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sigaltstack$UNIX2003"
)]
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> ::c_int;
pub fn sigsuspend(mask: *const ::sigset_t) -> ::c_int;
pub fn sem_close(sem: *mut sem_t) -> ::c_int;
pub fn getdtablesize() -> ::c_int;
pub fn getgrnam_r(
name: *const ::c_char,
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_sigmask$UNIX2003"
)]
pub fn pthread_sigmask(how: ::c_int, set: *const sigset_t, oldset: *mut sigset_t) -> ::c_int;
pub fn sem_open(name: *const ::c_char, oflag: ::c_int, ...) -> *mut sem_t;
pub fn getgrnam(name: *const ::c_char) -> *mut ::group;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "pthread_cancel$UNIX2003"
)]
pub fn pthread_cancel(thread: ::pthread_t) -> ::c_int;
pub fn pthread_kill(thread: ::pthread_t, sig: ::c_int) -> ::c_int;
pub fn sched_get_priority_min(policy: ::c_int) -> ::c_int;
pub fn sched_get_priority_max(policy: ::c_int) -> ::c_int;
pub fn sem_unlink(name: *const ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")]
pub fn getpwnam_r(
name: *const ::c_char,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
pub fn getpwuid_r(
uid: ::uid_t,
pwd: *mut passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut passwd,
) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "sigwait$UNIX2003"
)]
pub fn sigwait(set: *const sigset_t, sig: *mut ::c_int) -> ::c_int;
pub fn pthread_atfork(
prepare: ::Option,
parent: ::Option,
child: ::Option,
) -> ::c_int;
pub fn getgrgid(gid: ::gid_t) -> *mut ::group;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "popen$UNIX2003"
)]
pub fn popen(command: *const c_char, mode: *const c_char) -> *mut ::FILE;
pub fn faccessat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::c_int,
flags: ::c_int,
) -> ::c_int;
pub fn pthread_create(
native: *mut ::pthread_t,
attr: *const ::pthread_attr_t,
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
value: *mut ::c_void,
) -> ::c_int;
pub fn acct(filename: *const ::c_char) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "wait4$UNIX2003"
)]
#[cfg_attr(
all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)),
link_name = "wait4@FBSD_1.0"
)]
pub fn wait4(
pid: ::pid_t,
status: *mut ::c_int,
options: ::c_int,
rusage: *mut ::rusage,
) -> ::pid_t;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "getitimer$UNIX2003"
)]
pub fn getitimer(which: ::c_int, curr_value: *mut ::itimerval) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
link_name = "setitimer$UNIX2003"
)]
pub fn setitimer(
which: ::c_int,
new_value: *const ::itimerval,
old_value: *mut ::itimerval,
) -> ::c_int;
pub fn regcomp(preg: *mut regex_t, pattern: *const ::c_char, cflags: ::c_int) -> ::c_int;
pub fn regexec(
preg: *const regex_t,
input: *const ::c_char,
nmatch: ::size_t,
pmatch: *mut regmatch_t,
eflags: ::c_int,
) -> ::c_int;
pub fn regerror(
errcode: ::c_int,
preg: *const regex_t,
errbuf: *mut ::c_char,
errbuf_size: ::size_t,
) -> ::size_t;
pub fn regfree(preg: *mut regex_t);
pub fn arc4random() -> u32;
pub fn arc4random_buf(buf: *mut ::c_void, size: ::size_t);
pub fn arc4random_uniform(l: u32) -> u32;
pub fn drand48() -> ::c_double;
pub fn erand48(xseed: *mut ::c_ushort) -> ::c_double;
pub fn lrand48() -> ::c_long;
pub fn nrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn mrand48() -> ::c_long;
pub fn jrand48(xseed: *mut ::c_ushort) -> ::c_long;
pub fn srand48(seed: ::c_long);
pub fn seed48(xseed: *mut ::c_ushort) -> *mut ::c_ushort;
pub fn lcong48(p: *mut ::c_ushort);
pub fn getopt_long(
argc: ::c_int,
argv: *const *mut c_char,
optstring: *const c_char,
longopts: *const option,
longindex: *mut ::c_int,
) -> ::c_int;
pub fn strftime(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
) -> ::size_t;
pub fn strftime_l(
buf: *mut ::c_char,
maxsize: ::size_t,
format: *const ::c_char,
timeptr: *const ::tm,
locale: ::locale_t,
) -> ::size_t;
}
cfg_if! {
if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] {
mod apple;
pub use self::apple::*;
} else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] {
mod netbsdlike;
pub use self::netbsdlike::*;
} else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] {
mod freebsdlike;
pub use self::freebsdlike::*;
} else {
// Unknown target_os
}
}
libc-0.2.152/src/unix/bsd/netbsdlike/mod.rs 0000644 0000000 0000000 00000070576 10461020230 0016516 0 ustar 0000000 0000000 pub type wchar_t = i32;
pub type time_t = i64;
pub type mode_t = u32;
pub type nlink_t = u32;
pub type ino_t = u64;
pub type pthread_key_t = ::c_int;
pub type rlim_t = u64;
pub type speed_t = ::c_uint;
pub type tcflag_t = ::c_uint;
pub type nl_item = c_long;
pub type clockid_t = ::c_int;
pub type id_t = u32;
pub type sem_t = *mut sem;
pub type key_t = c_long;
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
impl ::Copy for timezone {}
impl ::Clone for timezone {
fn clone(&self) -> timezone {
*self
}
}
#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum sem {}
impl ::Copy for sem {}
impl ::Clone for sem {
fn clone(&self) -> sem {
*self
}
}
s! {
pub struct sched_param {
pub sched_priority: ::c_int,
}
pub struct sigaction {
pub sa_sigaction: ::sighandler_t,
pub sa_mask: ::sigset_t,
pub sa_flags: ::c_int,
}
pub struct stack_t {
pub ss_sp: *mut ::c_void,
pub ss_size: ::size_t,
pub ss_flags: ::c_int,
}
pub struct in6_pktinfo {
pub ipi6_addr: ::in6_addr,
pub ipi6_ifindex: ::c_uint,
}
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,
pub c_cflag: ::tcflag_t,
pub c_lflag: ::tcflag_t,
pub c_cc: [::cc_t; ::NCCS],
pub c_ispeed: ::c_int,
pub c_ospeed: ::c_int,
}
pub struct flock {
pub l_start: ::off_t,
pub l_len: ::off_t,
pub l_pid: ::pid_t,
pub l_type: ::c_short,
pub l_whence: ::c_short,
}
pub struct ipc_perm {
pub cuid: ::uid_t,
pub cgid: ::gid_t,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mode: ::mode_t,
#[cfg(target_os = "openbsd")]
pub seq: ::c_ushort,
#[cfg(target_os = "netbsd")]
pub _seq: ::c_ushort,
#[cfg(target_os = "openbsd")]
pub key: ::key_t,
#[cfg(target_os = "netbsd")]
pub _key: ::key_t,
}
pub struct ptrace_io_desc {
pub piod_op: ::c_int,
pub piod_offs: *mut ::c_void,
pub piod_addr: *mut ::c_void,
pub piod_len: ::size_t,
}
}
pub const D_T_FMT: ::nl_item = 0;
pub const D_FMT: ::nl_item = 1;
pub const T_FMT: ::nl_item = 2;
pub const T_FMT_AMPM: ::nl_item = 3;
pub const AM_STR: ::nl_item = 4;
pub const PM_STR: ::nl_item = 5;
pub const DAY_1: ::nl_item = 6;
pub const DAY_2: ::nl_item = 7;
pub const DAY_3: ::nl_item = 8;
pub const DAY_4: ::nl_item = 9;
pub const DAY_5: ::nl_item = 10;
pub const DAY_6: ::nl_item = 11;
pub const DAY_7: ::nl_item = 12;
pub const ABDAY_1: ::nl_item = 13;
pub const ABDAY_2: ::nl_item = 14;
pub const ABDAY_3: ::nl_item = 15;
pub const ABDAY_4: ::nl_item = 16;
pub const ABDAY_5: ::nl_item = 17;
pub const ABDAY_6: ::nl_item = 18;
pub const ABDAY_7: ::nl_item = 19;
pub const MON_1: ::nl_item = 20;
pub const MON_2: ::nl_item = 21;
pub const MON_3: ::nl_item = 22;
pub const MON_4: ::nl_item = 23;
pub const MON_5: ::nl_item = 24;
pub const MON_6: ::nl_item = 25;
pub const MON_7: ::nl_item = 26;
pub const MON_8: ::nl_item = 27;
pub const MON_9: ::nl_item = 28;
pub const MON_10: ::nl_item = 29;
pub const MON_11: ::nl_item = 30;
pub const MON_12: ::nl_item = 31;
pub const ABMON_1: ::nl_item = 32;
pub const ABMON_2: ::nl_item = 33;
pub const ABMON_3: ::nl_item = 34;
pub const ABMON_4: ::nl_item = 35;
pub const ABMON_5: ::nl_item = 36;
pub const ABMON_6: ::nl_item = 37;
pub const ABMON_7: ::nl_item = 38;
pub const ABMON_8: ::nl_item = 39;
pub const ABMON_9: ::nl_item = 40;
pub const ABMON_10: ::nl_item = 41;
pub const ABMON_11: ::nl_item = 42;
pub const ABMON_12: ::nl_item = 43;
pub const RADIXCHAR: ::nl_item = 44;
pub const THOUSEP: ::nl_item = 45;
pub const YESSTR: ::nl_item = 46;
pub const YESEXPR: ::nl_item = 47;
pub const NOSTR: ::nl_item = 48;
pub const NOEXPR: ::nl_item = 49;
pub const CRNCYSTR: ::nl_item = 50;
pub const CODESET: ::nl_item = 51;
pub const EXIT_FAILURE: ::c_int = 1;
pub const EXIT_SUCCESS: ::c_int = 0;
pub const RAND_MAX: ::c_int = 2147483647;
pub const EOF: ::c_int = -1;
pub const SEEK_SET: ::c_int = 0;
pub const SEEK_CUR: ::c_int = 1;
pub const SEEK_END: ::c_int = 2;
pub const _IOFBF: ::c_int = 0;
pub const _IONBF: ::c_int = 2;
pub const _IOLBF: ::c_int = 1;
pub const BUFSIZ: ::c_uint = 1024;
pub const FOPEN_MAX: ::c_uint = 20;
pub const FILENAME_MAX: ::c_uint = 1024;
pub const L_tmpnam: ::c_uint = 1024;
pub const O_NOCTTY: ::c_int = 32768;
pub const S_IFIFO: mode_t = 4096;
pub const S_IFCHR: mode_t = 8192;
pub const S_IFBLK: mode_t = 24576;
pub const S_IFDIR: mode_t = 16384;
pub const S_IFREG: mode_t = 32768;
pub const S_IFLNK: mode_t = 40960;
pub const S_IFSOCK: mode_t = 49152;
pub const S_IFMT: mode_t = 61440;
pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const S_IRWXU: mode_t = 448;
pub const S_IXUSR: mode_t = 64;
pub const S_IWUSR: mode_t = 128;
pub const S_IRUSR: mode_t = 256;
pub const S_IRWXG: mode_t = 56;
pub const S_IXGRP: mode_t = 8;
pub const S_IWGRP: mode_t = 16;
pub const S_IRGRP: mode_t = 32;
pub const S_IRWXO: mode_t = 7;
pub const S_IXOTH: mode_t = 1;
pub const S_IWOTH: mode_t = 2;
pub const S_IROTH: mode_t = 4;
pub const F_OK: ::c_int = 0;
pub const R_OK: ::c_int = 4;
pub const W_OK: ::c_int = 2;
pub const X_OK: ::c_int = 1;
pub const STDIN_FILENO: ::c_int = 0;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const F_LOCK: ::c_int = 1;
pub const F_TEST: ::c_int = 3;
pub const F_TLOCK: ::c_int = 2;
pub const F_ULOCK: ::c_int = 0;
pub const F_GETLK: ::c_int = 7;
pub const F_SETLK: ::c_int = 8;
pub const F_SETLKW: ::c_int = 9;
pub const SIGHUP: ::c_int = 1;
pub const SIGINT: ::c_int = 2;
pub const SIGQUIT: ::c_int = 3;
pub const SIGILL: ::c_int = 4;
pub const SIGABRT: ::c_int = 6;
pub const SIGEMT: ::c_int = 7;
pub const SIGFPE: ::c_int = 8;
pub const SIGKILL: ::c_int = 9;
pub const SIGSEGV: ::c_int = 11;
pub const SIGPIPE: ::c_int = 13;
pub const SIGALRM: ::c_int = 14;
pub const SIGTERM: ::c_int = 15;
pub const PROT_NONE: ::c_int = 0;
pub const PROT_READ: ::c_int = 1;
pub const PROT_WRITE: ::c_int = 2;
pub const PROT_EXEC: ::c_int = 4;
pub const MAP_FILE: ::c_int = 0x0000;
pub const MAP_SHARED: ::c_int = 0x0001;
pub const MAP_PRIVATE: ::c_int = 0x0002;
pub const MAP_FIXED: ::c_int = 0x0010;
pub const MAP_ANON: ::c_int = 0x1000;
pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
pub const IPC_CREAT: ::c_int = 0o001000;
pub const IPC_EXCL: ::c_int = 0o002000;
pub const IPC_NOWAIT: ::c_int = 0o004000;
pub const IPC_PRIVATE: ::key_t = 0;
pub const IPC_RMID: ::c_int = 0;
pub const IPC_SET: ::c_int = 1;
pub const IPC_STAT: ::c_int = 2;
pub const IPC_R: ::c_int = 0o000400;
pub const IPC_W: ::c_int = 0o000200;
pub const IPC_M: ::c_int = 0o010000;
pub const SHM_R: ::c_int = IPC_R;
pub const SHM_W: ::c_int = IPC_W;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
pub const MS_ASYNC: ::c_int = 0x0001;
pub const EPERM: ::c_int = 1;
pub const ENOENT: ::c_int = 2;
pub const ESRCH: ::c_int = 3;
pub const EINTR: ::c_int = 4;
pub const EIO: ::c_int = 5;
pub const ENXIO: ::c_int = 6;
pub const E2BIG: ::c_int = 7;
pub const ENOEXEC: ::c_int = 8;
pub const EBADF: ::c_int = 9;
pub const ECHILD: ::c_int = 10;
pub const EDEADLK: ::c_int = 11;
pub const ENOMEM: ::c_int = 12;
pub const EACCES: ::c_int = 13;
pub const EFAULT: ::c_int = 14;
pub const ENOTBLK: ::c_int = 15;
pub const EBUSY: ::c_int = 16;
pub const EEXIST: ::c_int = 17;
pub const EXDEV: ::c_int = 18;
pub const ENODEV: ::c_int = 19;
pub const ENOTDIR: ::c_int = 20;
pub const EISDIR: ::c_int = 21;
pub const EINVAL: ::c_int = 22;
pub const ENFILE: ::c_int = 23;
pub const EMFILE: ::c_int = 24;
pub const ENOTTY: ::c_int = 25;
pub const ETXTBSY: ::c_int = 26;
pub const EFBIG: ::c_int = 27;
pub const ENOSPC: ::c_int = 28;
pub const ESPIPE: ::c_int = 29;
pub const EROFS: ::c_int = 30;
pub const EMLINK: ::c_int = 31;
pub const EPIPE: ::c_int = 32;
pub const EDOM: ::c_int = 33;
pub const ERANGE: ::c_int = 34;
pub const EAGAIN: ::c_int = 35;
pub const EWOULDBLOCK: ::c_int = 35;
pub const EINPROGRESS: ::c_int = 36;
pub const EALREADY: ::c_int = 37;
pub const ENOTSOCK: ::c_int = 38;
pub const EDESTADDRREQ: ::c_int = 39;
pub const EMSGSIZE: ::c_int = 40;
pub const EPROTOTYPE: ::c_int = 41;
pub const ENOPROTOOPT: ::c_int = 42;
pub const EPROTONOSUPPORT: ::c_int = 43;
pub const ESOCKTNOSUPPORT: ::c_int = 44;
pub const EOPNOTSUPP: ::c_int = 45;
pub const EPFNOSUPPORT: ::c_int = 46;
pub const EAFNOSUPPORT: ::c_int = 47;
pub const EADDRINUSE: ::c_int = 48;
pub const EADDRNOTAVAIL: ::c_int = 49;
pub const ENETDOWN: ::c_int = 50;
pub const ENETUNREACH: ::c_int = 51;
pub const ENETRESET: ::c_int = 52;
pub const ECONNABORTED: ::c_int = 53;
pub const ECONNRESET: ::c_int = 54;
pub const ENOBUFS: ::c_int = 55;
pub const EISCONN: ::c_int = 56;
pub const ENOTCONN: ::c_int = 57;
pub const ESHUTDOWN: ::c_int = 58;
pub const ETOOMANYREFS: ::c_int = 59;
pub const ETIMEDOUT: ::c_int = 60;
pub const ECONNREFUSED: ::c_int = 61;
pub const ELOOP: ::c_int = 62;
pub const ENAMETOOLONG: ::c_int = 63;
pub const EHOSTDOWN: ::c_int = 64;
pub const EHOSTUNREACH: ::c_int = 65;
pub const ENOTEMPTY: ::c_int = 66;
pub const EPROCLIM: ::c_int = 67;
pub const EUSERS: ::c_int = 68;
pub const EDQUOT: ::c_int = 69;
pub const ESTALE: ::c_int = 70;
pub const EREMOTE: ::c_int = 71;
pub const EBADRPC: ::c_int = 72;
pub const ERPCMISMATCH: ::c_int = 73;
pub const EPROGUNAVAIL: ::c_int = 74;
pub const EPROGMISMATCH: ::c_int = 75;
pub const EPROCUNAVAIL: ::c_int = 76;
pub const ENOLCK: ::c_int = 77;
pub const ENOSYS: ::c_int = 78;
pub const EFTYPE: ::c_int = 79;
pub const EAUTH: ::c_int = 80;
pub const ENEEDAUTH: ::c_int = 81;
pub const F_DUPFD: ::c_int = 0;
pub const F_GETFD: ::c_int = 1;
pub const F_SETFD: ::c_int = 2;
pub const F_GETFL: ::c_int = 3;
pub const F_SETFL: ::c_int = 4;
pub const SIGTRAP: ::c_int = 5;
pub const GLOB_APPEND: ::c_int = 0x0001;
pub const GLOB_DOOFFS: ::c_int = 0x0002;
pub const GLOB_ERR: ::c_int = 0x0004;
pub const GLOB_MARK: ::c_int = 0x0008;
pub const GLOB_NOCHECK: ::c_int = 0x0010;
pub const GLOB_NOSORT: ::c_int = 0x0020;
pub const GLOB_NOESCAPE: ::c_int = 0x1000;
pub const GLOB_NOSPACE: ::c_int = -1;
pub const GLOB_ABORTED: ::c_int = -2;
pub const GLOB_NOMATCH: ::c_int = -3;
pub const GLOB_NOSYS: ::c_int = -4;
pub const POSIX_MADV_NORMAL: ::c_int = 0;
pub const POSIX_MADV_RANDOM: ::c_int = 1;
pub const POSIX_MADV_SEQUENTIAL: ::c_int = 2;
pub const POSIX_MADV_WILLNEED: ::c_int = 3;
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
pub const POSIX_SPAWN_RESETIDS: ::c_int = 0x01;
pub const POSIX_SPAWN_SETPGROUP: ::c_int = 0x02;
pub const POSIX_SPAWN_SETSCHEDPARAM: ::c_int = 0x04;
pub const POSIX_SPAWN_SETSCHEDULER: ::c_int = 0x08;
pub const POSIX_SPAWN_SETSIGDEF: ::c_int = 0x10;
pub const POSIX_SPAWN_SETSIGMASK: ::c_int = 0x20;
pub const PTHREAD_CREATE_JOINABLE: ::c_int = 0;
pub const PTHREAD_CREATE_DETACHED: ::c_int = 1;
pub const PIOD_READ_D: ::c_int = 1;
pub const PIOD_WRITE_D: ::c_int = 2;
pub const PIOD_READ_I: ::c_int = 3;
pub const PIOD_WRITE_I: ::c_int = 4;
pub const PIOD_READ_AUXV: ::c_int = 5;
pub const PT_TRACE_ME: ::c_int = 0;
pub const PT_READ_I: ::c_int = 1;
pub const PT_READ_D: ::c_int = 2;
pub const PT_WRITE_I: ::c_int = 4;
pub const PT_WRITE_D: ::c_int = 5;
pub const PT_CONTINUE: ::c_int = 7;
pub const PT_KILL: ::c_int = 8;
pub const PT_ATTACH: ::c_int = 9;
pub const PT_DETACH: ::c_int = 10;
pub const PT_IO: ::c_int = 11;
// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2
// The man page says clock_gettime(3) can accept various values as clockid_t but
// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161
// the implementation rejects anything other than the below two
//
// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime
// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222
// Basically the same goes for NetBSD
pub const CLOCK_REALTIME: ::clockid_t = 0;
pub const CLOCK_MONOTONIC: ::clockid_t = 3;
pub const RLIMIT_CPU: ::c_int = 0;
pub const RLIMIT_FSIZE: ::c_int = 1;
pub const RLIMIT_DATA: ::c_int = 2;
pub const RLIMIT_STACK: ::c_int = 3;
pub const RLIMIT_CORE: ::c_int = 4;
pub const RLIMIT_RSS: ::c_int = 5;
pub const RLIMIT_MEMLOCK: ::c_int = 6;
pub const RLIMIT_NPROC: ::c_int = 7;
pub const RLIMIT_NOFILE: ::c_int = 8;
pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff;
pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY;
pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY;
pub const RUSAGE_SELF: ::c_int = 0;
pub const RUSAGE_CHILDREN: ::c_int = -1;
pub const MADV_NORMAL: ::c_int = 0;
pub const MADV_RANDOM: ::c_int = 1;
pub const MADV_SEQUENTIAL: ::c_int = 2;
pub const MADV_WILLNEED: ::c_int = 3;
pub const MADV_DONTNEED: ::c_int = 4;
pub const MADV_FREE: ::c_int = 6;
// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD
pub const MNT_NODEV: ::c_int = 0x00000010;
pub const MNT_LOCAL: ::c_int = 0x00001000;
pub const MNT_QUOTA: ::c_int = 0x00002000;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1;
pub const AF_UNIX: ::c_int = AF_LOCAL;
pub const AF_INET: ::c_int = 2;
pub const AF_IMPLINK: ::c_int = 3;
pub const AF_PUP: ::c_int = 4;
pub const AF_CHAOS: ::c_int = 5;
pub const AF_NS: ::c_int = 6;
pub const AF_ISO: ::c_int = 7;
pub const AF_OSI: ::c_int = AF_ISO;
pub const AF_DATAKIT: ::c_int = 9;
pub const AF_CCITT: ::c_int = 10;
pub const AF_SNA: ::c_int = 11;
pub const AF_DECnet: ::c_int = 12;
pub const AF_DLI: ::c_int = 13;
pub const AF_LAT: ::c_int = 14;
pub const AF_HYLINK: ::c_int = 15;
pub const AF_APPLETALK: ::c_int = 16;
pub const AF_LINK: ::c_int = 18;
pub const pseudo_AF_XTP: ::c_int = 19;
pub const AF_COIP: ::c_int = 20;
pub const AF_CNT: ::c_int = 21;
pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_INET6: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
pub const AF_ISDN: ::c_int = 26;
pub const AF_E164: ::c_int = AF_ISDN;
pub const AF_NATM: ::c_int = 27;
pub const PF_UNSPEC: ::c_int = AF_UNSPEC;
pub const PF_LOCAL: ::c_int = AF_LOCAL;
pub const PF_UNIX: ::c_int = PF_LOCAL;
pub const PF_INET: ::c_int = AF_INET;
pub const PF_IMPLINK: ::c_int = AF_IMPLINK;
pub const PF_PUP: ::c_int = AF_PUP;
pub const PF_CHAOS: ::c_int = AF_CHAOS;
pub const PF_NS: ::c_int = AF_NS;
pub const PF_ISO: ::c_int = AF_ISO;
pub const PF_OSI: ::c_int = AF_ISO;
pub const PF_DATAKIT: ::c_int = AF_DATAKIT;
pub const PF_CCITT: ::c_int = AF_CCITT;
pub const PF_SNA: ::c_int = AF_SNA;
pub const PF_DECnet: ::c_int = AF_DECnet;
pub const PF_DLI: ::c_int = AF_DLI;
pub const PF_LAT: ::c_int = AF_LAT;
pub const PF_HYLINK: ::c_int = AF_HYLINK;
pub const PF_APPLETALK: ::c_int = AF_APPLETALK;
pub const PF_LINK: ::c_int = AF_LINK;
pub const PF_XTP: ::c_int = pseudo_AF_XTP;
pub const PF_COIP: ::c_int = AF_COIP;
pub const PF_CNT: ::c_int = AF_CNT;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_INET6: ::c_int = AF_INET6;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_NATM: ::c_int = AF_NATM;
pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
pub const SOCK_RAW: ::c_int = 3;
pub const SOCK_RDM: ::c_int = 4;
pub const SOCK_SEQPACKET: ::c_int = 5;
pub const IP_TTL: ::c_int = 4;
pub const IP_HDRINCL: ::c_int = 2;
pub const IP_ADD_MEMBERSHIP: ::c_int = 12;
pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IPV6_RECVPKTINFO: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_RECVTCLASS: ::c_int = 57;
pub const IPV6_TCLASS: ::c_int = 61;
pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
pub const SO_ACCEPTCONN: ::c_int = 0x0002;
pub const SO_REUSEADDR: ::c_int = 0x0004;
pub const SO_KEEPALIVE: ::c_int = 0x0008;
pub const SO_DONTROUTE: ::c_int = 0x0010;
pub const SO_BROADCAST: ::c_int = 0x0020;
pub const SO_USELOOPBACK: ::c_int = 0x0040;
pub const SO_LINGER: ::c_int = 0x0080;
pub const SO_OOBINLINE: ::c_int = 0x0100;
pub const SO_REUSEPORT: ::c_int = 0x0200;
pub const SO_SNDBUF: ::c_int = 0x1001;
pub const SO_RCVBUF: ::c_int = 0x1002;
pub const SO_SNDLOWAT: ::c_int = 0x1003;
pub const SO_RCVLOWAT: ::c_int = 0x1004;
pub const SO_ERROR: ::c_int = 0x1007;
pub const SO_TYPE: ::c_int = 0x1008;
pub const SOMAXCONN: ::c_int = 128;
pub const MSG_OOB: ::c_int = 0x1;
pub const MSG_PEEK: ::c_int = 0x2;
pub const MSG_DONTROUTE: ::c_int = 0x4;
pub const MSG_EOR: ::c_int = 0x8;
pub const MSG_TRUNC: ::c_int = 0x10;
pub const MSG_CTRUNC: ::c_int = 0x20;
pub const MSG_WAITALL: ::c_int = 0x40;
pub const MSG_DONTWAIT: ::c_int = 0x80;
pub const MSG_BCAST: ::c_int = 0x100;
pub const MSG_MCAST: ::c_int = 0x200;
pub const MSG_NOSIGNAL: ::c_int = 0x400;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x800;
pub const SHUT_RD: ::c_int = 0;
pub const SHUT_WR: ::c_int = 1;
pub const SHUT_RDWR: ::c_int = 2;
pub const LOCK_SH: ::c_int = 1;
pub const LOCK_EX: ::c_int = 2;
pub const LOCK_NB: ::c_int = 4;
pub const LOCK_UN: ::c_int = 8;
pub const IPPROTO_RAW: ::c_int = 255;
pub const _SC_ARG_MAX: ::c_int = 1;
pub const _SC_CHILD_MAX: ::c_int = 2;
pub const _SC_NGROUPS_MAX: ::c_int = 4;
pub const _SC_OPEN_MAX: ::c_int = 5;
pub const _SC_JOB_CONTROL: ::c_int = 6;
pub const _SC_SAVED_IDS: ::c_int = 7;
pub const _SC_VERSION: ::c_int = 8;
pub const _SC_BC_BASE_MAX: ::c_int = 9;
pub const _SC_BC_DIM_MAX: ::c_int = 10;
pub const _SC_BC_SCALE_MAX: ::c_int = 11;
pub const _SC_BC_STRING_MAX: ::c_int = 12;
pub const _SC_COLL_WEIGHTS_MAX: ::c_int = 13;
pub const _SC_EXPR_NEST_MAX: ::c_int = 14;
pub const _SC_LINE_MAX: ::c_int = 15;
pub const _SC_RE_DUP_MAX: ::c_int = 16;
pub const _SC_2_VERSION: ::c_int = 17;
pub const _SC_2_C_BIND: ::c_int = 18;
pub const _SC_2_C_DEV: ::c_int = 19;
pub const _SC_2_CHAR_TERM: ::c_int = 20;
pub const _SC_2_FORT_DEV: ::c_int = 21;
pub const _SC_2_FORT_RUN: ::c_int = 22;
pub const _SC_2_LOCALEDEF: ::c_int = 23;
pub const _SC_2_SW_DEV: ::c_int = 24;
pub const _SC_2_UPE: ::c_int = 25;
pub const _SC_STREAM_MAX: ::c_int = 26;
pub const _SC_TZNAME_MAX: ::c_int = 27;
pub const _SC_PAGESIZE: ::c_int = 28;
pub const _SC_PAGE_SIZE: ::c_int = _SC_PAGESIZE;
pub const _SC_FSYNC: ::c_int = 29;
pub const _SC_XOPEN_SHM: ::c_int = 30;
pub const Q_GETQUOTA: ::c_int = 0x300;
pub const Q_SETQUOTA: ::c_int = 0x400;
pub const RTLD_GLOBAL: ::c_int = 0x100;
pub const LOG_NFACILITIES: ::c_int = 24;
pub const HW_NCPU: ::c_int = 3;
pub const B0: speed_t = 0;
pub const B50: speed_t = 50;
pub const B75: speed_t = 75;
pub const B110: speed_t = 110;
pub const B134: speed_t = 134;
pub const B150: speed_t = 150;
pub const B200: speed_t = 200;
pub const B300: speed_t = 300;
pub const B600: speed_t = 600;
pub const B1200: speed_t = 1200;
pub const B1800: speed_t = 1800;
pub const B2400: speed_t = 2400;
pub const B4800: speed_t = 4800;
pub const B9600: speed_t = 9600;
pub const B19200: speed_t = 19200;
pub const B38400: speed_t = 38400;
pub const B7200: speed_t = 7200;
pub const B14400: speed_t = 14400;
pub const B28800: speed_t = 28800;
pub const B57600: speed_t = 57600;
pub const B76800: speed_t = 76800;
pub const B115200: speed_t = 115200;
pub const B230400: speed_t = 230400;
pub const EXTA: speed_t = 19200;
pub const EXTB: speed_t = 38400;
pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t;
pub const CRTSCTS: ::tcflag_t = 0x00010000;
pub const CRTS_IFLOW: ::tcflag_t = CRTSCTS;
pub const CCTS_OFLOW: ::tcflag_t = CRTSCTS;
pub const OCRNL: ::tcflag_t = 0x10;
pub const TIOCEXCL: ::c_ulong = 0x2000740d;
pub const TIOCNXCL: ::c_ulong = 0x2000740e;
pub const TIOCFLUSH: ::c_ulong = 0x80047410;
pub const TIOCGETA: ::c_ulong = 0x402c7413;
pub const TIOCSETA: ::c_ulong = 0x802c7414;
pub const TIOCSETAW: ::c_ulong = 0x802c7415;
pub const TIOCSETAF: ::c_ulong = 0x802c7416;
pub const TIOCGETD: ::c_ulong = 0x4004741a;
pub const TIOCSETD: ::c_ulong = 0x8004741b;
pub const TIOCMGET: ::c_ulong = 0x4004746a;
pub const TIOCMBIC: ::c_ulong = 0x8004746b;
pub const TIOCMBIS: ::c_ulong = 0x8004746c;
pub const TIOCMSET: ::c_ulong = 0x8004746d;
pub const TIOCSTART: ::c_ulong = 0x2000746e;
pub const TIOCSTOP: ::c_ulong = 0x2000746f;
pub const TIOCSCTTY: ::c_ulong = 0x20007461;
pub const TIOCGWINSZ: ::c_ulong = 0x40087468;
pub const TIOCSWINSZ: ::c_ulong = 0x80087467;
pub const TIOCM_LE: ::c_int = 0o0001;
pub const TIOCM_DTR: ::c_int = 0o0002;
pub const TIOCM_RTS: ::c_int = 0o0004;
pub const TIOCM_ST: ::c_int = 0o0010;
pub const TIOCM_SR: ::c_int = 0o0020;
pub const TIOCM_CTS: ::c_int = 0o0040;
pub const TIOCM_CAR: ::c_int = 0o0100;
pub const TIOCM_RNG: ::c_int = 0o0200;
pub const TIOCM_DSR: ::c_int = 0o0400;
pub const TIOCM_CD: ::c_int = TIOCM_CAR;
pub const TIOCM_RI: ::c_int = TIOCM_RNG;
pub const TIMER_ABSTIME: ::c_int = 1;
// sys/reboot.h
pub const RB_AUTOBOOT: ::c_int = 0;
pub const TCP_INFO: ::c_int = 9;
#[link(name = "util")]
extern "C" {
pub fn setgrent();
pub fn sem_destroy(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t, pshared: ::c_int, value: ::c_uint) -> ::c_int;
pub fn daemon(nochdir: ::c_int, noclose: ::c_int) -> ::c_int;
pub fn accept4(
s: ::c_int,
addr: *mut ::sockaddr,
addrlen: *mut ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")]
pub fn clock_getres(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
pub fn clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")]
pub fn clock_settime(clk_id: ::clockid_t, tp: *const ::timespec) -> ::c_int;
pub fn __errno() -> *mut ::c_int;
pub fn shm_open(name: *const ::c_char, oflag: ::c_int, mode: ::mode_t) -> ::c_int;
pub fn memrchr(cx: *const ::c_void, c: ::c_int, n: ::size_t) -> *mut ::c_void;
pub fn mkostemp(template: *mut ::c_char, flags: ::c_int) -> ::c_int;
pub fn mkostemps(template: *mut ::c_char, suffixlen: ::c_int, flags: ::c_int) -> ::c_int;
pub fn pwritev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t)
-> ::ssize_t;
pub fn preadv(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int, offset: ::off_t) -> ::ssize_t;
pub fn futimens(fd: ::c_int, times: *const ::timespec) -> ::c_int;
pub fn utimensat(
dirfd: ::c_int,
path: *const ::c_char,
times: *const ::timespec,
flag: ::c_int,
) -> ::c_int;
pub fn fdatasync(fd: ::c_int) -> ::c_int;
pub fn login_tty(fd: ::c_int) -> ::c_int;
pub fn getpriority(which: ::c_int, who: ::id_t) -> ::c_int;
pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
pub fn mknodat(
dirfd: ::c_int,
pathname: *const ::c_char,
mode: ::mode_t,
dev: dev_t,
) -> ::c_int;
pub fn mkfifoat(dirfd: ::c_int, pathname: *const ::c_char, mode: ::mode_t) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t, abstime: *const ::timespec) -> ::c_int;
pub fn sem_getvalue(sem: *mut sem_t, sval: *mut ::c_int) -> ::c_int;
pub fn pthread_condattr_setclock(
attr: *mut pthread_condattr_t,
clock_id: ::clockid_t,
) -> ::c_int;
pub fn sethostname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
abstime: *const ::timespec,
) -> ::c_int;
pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> ::c_int;
pub fn pthread_setschedparam(
native: ::pthread_t,
policy: ::c_int,
param: *const sched_param,
) -> ::c_int;
pub fn pthread_getschedparam(
native: ::pthread_t,
policy: *mut ::c_int,
param: *mut sched_param,
) -> ::c_int;
pub fn pipe2(fds: *mut ::c_int, flags: ::c_int) -> ::c_int;
pub fn getgrouplist(
name: *const ::c_char,
basegid: ::gid_t,
groups: *mut ::gid_t,
ngroups: *mut ::c_int,
) -> ::c_int;
pub fn initgroups(name: *const ::c_char, basegid: ::gid_t) -> ::c_int;
pub fn getdomainname(name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn setdomainname(name: *const ::c_char, len: ::size_t) -> ::c_int;
pub fn uname(buf: *mut ::utsname) -> ::c_int;
pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int;
pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void;
pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int;
pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int;
pub fn execvpe(
file: *const ::c_char,
argv: *const *const ::c_char,
envp: *const *const ::c_char,
) -> ::c_int;
pub fn waitid(
idtype: idtype_t,
id: ::id_t,
infop: *mut ::siginfo_t,
options: ::c_int,
) -> ::c_int;
pub fn posix_spawn(
pid: *mut ::pid_t,
path: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnp(
pid: *mut ::pid_t,
file: *const ::c_char,
file_actions: *const ::posix_spawn_file_actions_t,
attrp: *const ::posix_spawnattr_t,
argv: *const *mut ::c_char,
envp: *const *mut ::c_char,
) -> ::c_int;
pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> ::c_int;
pub fn posix_spawnattr_getsigdefault(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigdefault(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getsigmask(
attr: *const posix_spawnattr_t,
default: *mut ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_setsigmask(
attr: *mut posix_spawnattr_t,
default: *const ::sigset_t,
) -> ::c_int;
pub fn posix_spawnattr_getflags(
attr: *const posix_spawnattr_t,
flags: *mut ::c_short,
) -> ::c_int;
pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: ::c_short) -> ::c_int;
pub fn posix_spawnattr_getpgroup(
attr: *const posix_spawnattr_t,
flags: *mut ::pid_t,
) -> ::c_int;
pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: ::pid_t) -> ::c_int;
pub fn posix_spawnattr_getschedpolicy(
attr: *const posix_spawnattr_t,
flags: *mut ::c_int,
) -> ::c_int;
pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: ::c_int) -> ::c_int;
pub fn posix_spawnattr_getschedparam(
attr: *const posix_spawnattr_t,
param: *mut ::sched_param,
) -> ::c_int;
pub fn posix_spawnattr_setschedparam(
attr: *mut posix_spawnattr_t,
param: *const ::sched_param,
) -> ::c_int;
pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> ::c_int;
pub fn posix_spawn_file_actions_addopen(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
path: *const ::c_char,
oflag: ::c_int,
mode: ::mode_t,
) -> ::c_int;
pub fn posix_spawn_file_actions_addclose(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
) -> ::c_int;
pub fn posix_spawn_file_actions_adddup2(
actions: *mut posix_spawn_file_actions_t,
fd: ::c_int,
newfd: ::c_int,
) -> ::c_int;
}
extern "C" {
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn gethostid() -> ::c_long;
pub fn sethostid(hostid: ::c_long) -> ::c_int;
pub fn ftok(path: *const ::c_char, id: ::c_int) -> ::key_t;
pub fn dirname(path: *mut ::c_char) -> *mut ::c_char;
pub fn basename(path: *mut ::c_char) -> *mut ::c_char;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
}
cfg_if! {
if #[cfg(target_os = "netbsd")] {
mod netbsd;
pub use self::netbsd::*;
} else if #[cfg(target_os = "openbsd")] {
mod openbsd;
pub use self::openbsd::*;
} else {
// Unknown target_os
}
}
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/aarch64.rs 0000644 0000000 0000000 00000011416 10461020230 0020432 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
s! {
pub struct __fregset {
#[cfg(libc_union)]
pub __qregs: [__c_anonymous__freg; 32],
pub __fpcr: u32,
pub __fpsr: u32,
}
pub struct mcontext_t {
pub __gregs: [::greg_t; 32],
pub __fregs: __fregset,
__spare: [::greg_t; 8],
}
pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: mcontext_t,
}
}
s_no_extra_traits! {
#[cfg(libc_union)]
#[repr(align(16))]
pub union __c_anonymous__freg {
pub __b8: [u8; 16],
pub __h16: [u16; 8],
pub __s32: [u32; 4],
pub __d64: [u64; 2],
pub __q128: [u128; 1],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
#[cfg(libc_union)]
impl PartialEq for __c_anonymous__freg {
fn eq(&self, other: &__c_anonymous__freg) -> bool {
unsafe {
self.__b8 == other.__b8
|| self.__h16 == other.__h16
|| self.__s32 == other.__s32
|| self.__d64 == other.__d64
|| self.__q128 == other.__q128
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous__freg {}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous__freg {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
f.debug_struct("__c_anonymous__freg")
.field("__b8", &self.__b8)
.field("__h16", &self.__h16)
.field("__s32", &self.__s32)
.field("__d64", &self.__d64)
.field("__q128", &self.__q128)
.finish()
}
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous__freg {
fn hash(&self, state: &mut H) {
unsafe {
self.__b8.hash(state);
self.__h16.hash(state);
self.__s32.hash(state);
self.__d64.hash(state);
self.__q128.hash(state);
}
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;
pub const _REG_RV: ::c_int = _REG_X0;
pub const _REG_FP: ::c_int = _REG_X29;
pub const _REG_LR: ::c_int = _REG_X30;
pub const _REG_SP: ::c_int = _REG_X31;
pub const _REG_PC: ::c_int = _REG_ELR;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/arm.rs 0000644 0000000 0000000 00000004774 10461020230 0017772 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
pub const _REG_R0: ::c_int = 0;
pub const _REG_R1: ::c_int = 1;
pub const _REG_R2: ::c_int = 2;
pub const _REG_R3: ::c_int = 3;
pub const _REG_R4: ::c_int = 4;
pub const _REG_R5: ::c_int = 5;
pub const _REG_R6: ::c_int = 6;
pub const _REG_R7: ::c_int = 7;
pub const _REG_R8: ::c_int = 8;
pub const _REG_R9: ::c_int = 9;
pub const _REG_R10: ::c_int = 10;
pub const _REG_R11: ::c_int = 11;
pub const _REG_R12: ::c_int = 12;
pub const _REG_R13: ::c_int = 13;
pub const _REG_R14: ::c_int = 14;
pub const _REG_R15: ::c_int = 15;
pub const _REG_CPSR: ::c_int = 16;
pub const _REG_X0: ::c_int = 0;
pub const _REG_X1: ::c_int = 1;
pub const _REG_X2: ::c_int = 2;
pub const _REG_X3: ::c_int = 3;
pub const _REG_X4: ::c_int = 4;
pub const _REG_X5: ::c_int = 5;
pub const _REG_X6: ::c_int = 6;
pub const _REG_X7: ::c_int = 7;
pub const _REG_X8: ::c_int = 8;
pub const _REG_X9: ::c_int = 9;
pub const _REG_X10: ::c_int = 10;
pub const _REG_X11: ::c_int = 11;
pub const _REG_X12: ::c_int = 12;
pub const _REG_X13: ::c_int = 13;
pub const _REG_X14: ::c_int = 14;
pub const _REG_X15: ::c_int = 15;
pub const _REG_X16: ::c_int = 16;
pub const _REG_X17: ::c_int = 17;
pub const _REG_X18: ::c_int = 18;
pub const _REG_X19: ::c_int = 19;
pub const _REG_X20: ::c_int = 20;
pub const _REG_X21: ::c_int = 21;
pub const _REG_X22: ::c_int = 22;
pub const _REG_X23: ::c_int = 23;
pub const _REG_X24: ::c_int = 24;
pub const _REG_X25: ::c_int = 25;
pub const _REG_X26: ::c_int = 26;
pub const _REG_X27: ::c_int = 27;
pub const _REG_X28: ::c_int = 28;
pub const _REG_X29: ::c_int = 29;
pub const _REG_X30: ::c_int = 30;
pub const _REG_X31: ::c_int = 31;
pub const _REG_ELR: ::c_int = 32;
pub const _REG_SPSR: ::c_int = 33;
pub const _REG_TIPDR: ::c_int = 34;
pub const _REG_RV: ::c_int = _REG_R0;
pub const _REG_FP: ::c_int = _REG_R11;
pub const _REG_LR: ::c_int = _REG_R13;
pub const _REG_SP: ::c_int = _REG_R14;
pub const _REG_PC: ::c_int = _REG_R15;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/mips.rs 0000644 0000000 0000000 00000001101 10461020230 0020140 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_int;
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/mod.rs 0000644 0000000 0000000 00000313173 10461020230 0017766 0 ustar 0000000 0000000 pub type clock_t = ::c_uint;
pub type suseconds_t = ::c_int;
pub type dev_t = u64;
pub type blksize_t = i32;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_int;
pub type mqd_t = ::c_int;
type __pthread_spin_t = __cpu_simple_lock_nv_t;
pub type vm_size_t = ::uintptr_t; // FIXME: deprecated since long time
pub type lwpid_t = ::c_uint;
pub type shmatt_t = ::c_uint;
pub type cpuid_t = ::c_ulong;
pub type cpuset_t = _cpuset;
pub type pthread_spin_t = ::c_uchar;
pub type timer_t = ::c_int;
// elf.h
pub type Elf32_Addr = u32;
pub type Elf32_Half = u16;
pub type Elf32_Lword = u64;
pub type Elf32_Off = u32;
pub type Elf32_Sword = i32;
pub type Elf32_Word = u32;
pub type Elf64_Addr = u64;
pub type Elf64_Half = u16;
pub type Elf64_Lword = u64;
pub type Elf64_Off = u64;
pub type Elf64_Sword = i32;
pub type Elf64_Sxword = i64;
pub type Elf64_Word = u32;
pub type Elf64_Xword = u64;
pub type iconv_t = *mut ::c_void;
e! {
pub enum fae_action {
FAE_OPEN,
FAE_DUP2,
FAE_CLOSE,
}
}
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
type Elf_Half = Elf64_Half;
type Elf_Phdr = Elf64_Phdr;
} else if #[cfg(target_pointer_width = "32")] {
type Elf_Addr = Elf32_Addr;
type Elf_Half = Elf32_Half;
type Elf_Phdr = Elf32_Phdr;
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_void {
self.si_addr
}
pub unsafe fn si_code(&self) -> ::c_int {
self.si_code
}
pub unsafe fn si_errno(&self) -> ::c_int {
self.si_errno
}
pub unsafe fn si_pid(&self) -> ::pid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
_uid: ::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
}
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
_uid: ::uid_t,
value: ::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).value
}
pub unsafe fn si_status(&self) -> ::c_int {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_errno: ::c_int,
_si_code: ::c_int,
__pad1: ::c_int,
_pid: ::pid_t,
_uid: ::uid_t,
_value: ::sigval,
_cpid: ::pid_t,
_cuid: ::uid_t,
status: ::c_int,
}
(*(self as *const siginfo_t as *const siginfo_timer)).status
}
}
s! {
pub struct aiocb {
pub aio_offset: ::off_t,
pub aio_buf: *mut ::c_void,
pub aio_nbytes: ::size_t,
pub aio_fildes: ::c_int,
pub aio_lio_opcode: ::c_int,
pub aio_reqprio: ::c_int,
pub aio_sigevent: ::sigevent,
_state: ::c_int,
_errno: ::c_int,
_retval: ::ssize_t
}
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_matchc: ::size_t,
pub gl_offs: ::size_t,
pub gl_flags: ::c_int,
pub gl_pathv: *mut *mut ::c_char,
__unused3: *mut ::c_void,
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
__unused6: *mut ::c_void,
__unused7: *mut ::c_void,
__unused8: *mut ::c_void,
}
pub struct mq_attr {
pub mq_flags: ::c_long,
pub mq_maxmsg: ::c_long,
pub mq_msgsize: ::c_long,
pub mq_curmsgs: ::c_long,
}
pub struct itimerspec {
pub it_interval: ::timespec,
pub it_value: ::timespec,
}
pub struct sigset_t {
__bits: [u32; 4],
}
pub struct stat {
pub st_dev: ::dev_t,
pub st_mode: ::mode_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atimensec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtimensec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctimensec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtimensec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: u32,
pub st_gen: u32,
pub st_spare: [u32; 2],
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::socklen_t,
pub ai_canonname: *mut ::c_char,
pub ai_addr: *mut ::sockaddr,
pub ai_next: *mut ::addrinfo,
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_code: ::c_int,
pub si_errno: ::c_int,
__pad1: ::c_int,
pub si_addr: *mut ::c_void,
__pad2: [u64; 13],
}
pub struct pthread_attr_t {
pta_magic: ::c_uint,
pta_flags: ::c_int,
pta_private: *mut ::c_void,
}
pub struct pthread_mutex_t {
ptm_magic: ::c_uint,
ptm_errorcheck: __pthread_spin_t,
#[cfg(any(target_arch = "sparc", target_arch = "sparc64",
target_arch = "x86", target_arch = "x86_64"))]
ptm_pad1: [u8; 3],
// actually a union with a non-unused, 0-initialized field
ptm_unused: __pthread_spin_t,
#[cfg(any(target_arch = "sparc", target_arch = "sparc64",
target_arch = "x86", target_arch = "x86_64"))]
ptm_pad2: [u8; 3],
ptm_owner: ::pthread_t,
ptm_waiters: *mut u8,
ptm_recursed: ::c_uint,
ptm_spare2: *mut ::c_void,
}
pub struct pthread_mutexattr_t {
ptma_magic: ::c_uint,
ptma_private: *mut ::c_void,
}
pub struct pthread_rwlockattr_t {
ptra_magic: ::c_uint,
ptra_private: *mut ::c_void,
}
pub struct pthread_cond_t {
ptc_magic: ::c_uint,
ptc_lock: __pthread_spin_t,
ptc_waiters_first: *mut u8,
ptc_waiters_last: *mut u8,
ptc_mutex: *mut ::pthread_mutex_t,
ptc_private: *mut ::c_void,
}
pub struct pthread_condattr_t {
ptca_magic: ::c_uint,
ptca_private: *mut ::c_void,
}
pub struct pthread_rwlock_t {
ptr_magic: ::c_uint,
ptr_interlock: __pthread_spin_t,
ptr_rblocked_first: *mut u8,
ptr_rblocked_last: *mut u8,
ptr_wblocked_first: *mut u8,
ptr_wblocked_last: *mut u8,
ptr_nreaders: ::c_uint,
ptr_owner: ::pthread_t,
ptr_private: *mut ::c_void,
}
pub struct pthread_spinlock_t {
pts_magic: ::c_uint,
pts_spin: ::pthread_spin_t,
pts_flags: ::c_int,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: u32,
pub flags: u32,
pub fflags: u32,
pub data: i64,
pub udata: ::intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */
}
pub struct dqblk {
pub dqb_bhardlimit: u32,
pub dqb_bsoftlimit: u32,
pub dqb_curblocks: u32,
pub dqb_ihardlimit: u32,
pub dqb_isoftlimit: u32,
pub dqb_curinodes: u32,
pub dqb_btime: i32,
pub dqb_itime: i32,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *const ::c_void,
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_link_state: ::c_int,
pub ifi_mtu: u64,
pub ifi_metric: u64,
pub ifi_baudrate: u64,
pub ifi_ipackets: u64,
pub ifi_ierrors: u64,
pub ifi_opackets: u64,
pub ifi_oerrors: u64,
pub ifi_collisions: u64,
pub ifi_ibytes: u64,
pub ifi_obytes: u64,
pub ifi_imcasts: u64,
pub ifi_omcasts: u64,
pub ifi_iqdrops: u64,
pub ifi_noproto: u64,
pub ifi_lastchange: ::timespec,
}
pub struct if_msghdr {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_index: ::c_ushort,
pub ifm_data: if_data,
}
pub struct sockcred {
pub sc_pid: ::pid_t,
pub sc_uid: ::uid_t,
pub sc_euid: ::uid_t,
pub sc_gid: ::gid_t,
pub sc_egid: ::gid_t,
pub sc_ngroups: ::c_int,
pub sc_groups: [::gid_t; 1],
}
pub struct uucred {
pub cr_unused: ::c_ushort,
pub cr_uid: ::uid_t,
pub cr_gid: ::gid_t,
pub cr_ngroups: ::c_int,
pub cr_groups: [::gid_t; NGROUPS_MAX as usize],
}
pub struct unpcbid {
pub unp_pid: ::pid_t,
pub unp_euid: ::uid_t,
pub unp_egid: ::gid_t,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: u8,
pub sdl_nlen: u8,
pub sdl_alen: u8,
pub sdl_slen: u8,
pub sdl_data: [::c_char; 12],
}
pub struct mmsghdr {
pub msg_hdr: ::msghdr,
pub msg_len: ::c_uint,
}
pub struct __exit_status {
pub e_termination: u16,
pub e_exit: u16,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::size_t,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::shmatt_t,
pub shm_atime: ::time_t,
pub shm_dtime: ::time_t,
pub shm_ctime: ::time_t,
_shm_internal: *mut ::c_void,
}
pub struct utmp {
pub ut_line: [::c_char; UT_LINESIZE],
pub ut_name: [::c_char; UT_NAMESIZE],
pub ut_host: [::c_char; UT_HOSTSIZE],
pub ut_time: ::time_t
}
pub struct lastlog {
pub ll_line: [::c_char; UT_LINESIZE],
pub ll_host: [::c_char; UT_HOSTSIZE],
pub ll_time: ::time_t
}
pub struct timex {
pub modes: ::c_uint,
pub offset: ::c_long,
pub freq: ::c_long,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub status: ::c_int,
pub constant: ::c_long,
pub precision: ::c_long,
pub tolerance: ::c_long,
pub ppsfreq: ::c_long,
pub jitter: ::c_long,
pub shift: ::c_int,
pub stabil: ::c_long,
pub jitcnt: ::c_long,
pub calcnt: ::c_long,
pub errcnt: ::c_long,
pub stbcnt: ::c_long,
}
pub struct ntptimeval {
pub time: ::timespec,
pub maxerror: ::c_long,
pub esterror: ::c_long,
pub tai: ::c_long,
pub time_state: ::c_int,
}
// elf.h
pub struct Elf32_Phdr {
pub p_type: Elf32_Word,
pub p_offset: Elf32_Off,
pub p_vaddr: Elf32_Addr,
pub p_paddr: Elf32_Addr,
pub p_filesz: Elf32_Word,
pub p_memsz: Elf32_Word,
pub p_flags: Elf32_Word,
pub p_align: Elf32_Word,
}
pub struct Elf64_Phdr {
pub p_type: Elf64_Word,
pub p_flags: Elf64_Word,
pub p_offset: Elf64_Off,
pub p_vaddr: Elf64_Addr,
pub p_paddr: Elf64_Addr,
pub p_filesz: Elf64_Xword,
pub p_memsz: Elf64_Xword,
pub p_align: Elf64_Xword,
}
pub struct Aux32Info {
pub a_type: Elf32_Word,
pub a_v: Elf32_Word,
}
pub struct Aux64Info {
pub a_type: Elf64_Word,
pub a_v: Elf64_Xword,
}
// link.h
pub struct dl_phdr_info {
pub dlpi_addr: Elf_Addr,
pub dlpi_name: *const ::c_char,
pub dlpi_phdr: *const Elf_Phdr,
pub dlpi_phnum: Elf_Half,
pub dlpi_adds: ::c_ulonglong,
pub dlpi_subs: ::c_ulonglong,
pub dlpi_tls_modid: usize,
pub dlpi_tls_data: *mut ::c_void,
}
pub struct _cpuset {
bits: [u32; 0]
}
pub struct accept_filter_arg {
pub af_name: [::c_char; 16],
af_arg: [[::c_char; 10]; 24],
}
pub struct ki_sigset_t {
pub __bits: [u32; 4],
}
pub struct kinfo_proc2 {
pub p_forw: u64,
pub p_back: u64,
pub p_paddr: u64,
pub p_addr: u64,
pub p_fd: u64,
pub p_cwdi: u64,
pub p_stats: u64,
pub p_limit: u64,
pub p_vmspace: u64,
pub p_sigacts: u64,
pub p_sess: u64,
pub p_tsess: u64,
pub p_ru: u64,
pub p_eflag: i32,
pub p_exitsig: i32,
pub p_flag: i32,
pub p_pid: i32,
pub p_ppid: i32,
pub p_sid: i32,
pub p__pgid: i32,
pub p_tpgid: i32,
pub p_uid: u32,
pub p_ruid: u32,
pub p_gid: u32,
pub p_rgid: u32,
pub p_groups: [u32; KI_NGROUPS as usize],
pub p_ngroups: i16,
pub p_jobc: i16,
pub p_tdev: u32,
pub p_estcpu: u32,
pub p_rtime_sec: u32,
pub p_rtime_usec: u32,
pub p_cpticks: i32,
pub p_pctcpu: u32,
pub p_swtime: u32,
pub p_slptime: u32,
pub p_schedflags: i32,
pub p_uticks: u64,
pub p_sticks: u64,
pub p_iticks: u64,
pub p_tracep: u64,
pub p_traceflag: i32,
pub p_holdcnt: i32,
pub p_siglist: ki_sigset_t,
pub p_sigmask: ki_sigset_t,
pub p_sigignore: ki_sigset_t,
pub p_sigcatch: ki_sigset_t,
pub p_stat: i8,
pub p_priority: u8,
pub p_usrpri: u8,
pub p_nice: u8,
pub p_xstat: u16,
pub p_acflag: u16,
pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
pub p_wchan: u64,
pub p_login: [::c_char; KI_MAXLOGNAME as usize],
pub p_vm_rssize: i32,
pub p_vm_tsize: i32,
pub p_vm_dsize: i32,
pub p_vm_ssize: i32,
pub p_uvalid: i64,
pub p_ustart_sec: u32,
pub p_ustart_usec: u32,
pub p_uutime_sec: u32,
pub p_uutime_usec: u32,
pub p_ustime_sec: u32,
pub p_ustime_usec: u32,
pub p_uru_maxrss: u64,
pub p_uru_ixrss: u64,
pub p_uru_idrss: u64,
pub p_uru_isrss: u64,
pub p_uru_minflt: u64,
pub p_uru_majflt: u64,
pub p_uru_nswap: u64,
pub p_uru_inblock: u64,
pub p_uru_oublock: u64,
pub p_uru_msgsnd: u64,
pub p_uru_msgrcv: u64,
pub p_uru_nsignals: u64,
pub p_uru_nvcsw: u64,
pub p_uru_nivcsw: u64,
pub p_uctime_sec: u32,
pub p_uctime_usec: u32,
pub p_cpuid: u64,
pub p_realflag: u64,
pub p_nlwps: u64,
pub p_nrlwps: u64,
pub p_realstat: u64,
pub p_svuid: u32,
pub p_svgid: u32,
pub p_ename: [::c_char; KI_MAXEMULLEN as usize],
pub p_vm_vsize: i64,
pub p_vm_msize: i64,
}
pub struct kinfo_lwp {
pub l_forw: u64,
pub l_back: u64,
pub l_laddr: u64,
pub l_addr: u64,
pub l_lid: i32,
pub l_flag: i32,
pub l_swtime: u32,
pub l_slptime: u32,
pub l_schedflags: i32,
pub l_holdcnt: i32,
pub l_priority: u8,
pub l_usrpri: u8,
pub l_stat: i8,
l_pad1: i8,
l_pad2: i32,
pub l_wmesg: [::c_char; KI_WMESGLEN as usize],
pub l_wchan: u64,
pub l_cpuid: u64,
pub l_rtime_sec: u32,
pub l_rtime_usec: u32,
pub l_cpticks: u32,
pub l_pctcpu: u32,
pub l_pid: u32,
pub l_name: [::c_char; KI_LNAMELEN as usize],
}
pub struct kinfo_vmentry {
pub kve_start: u64,
pub kve_end: u64,
pub kve_offset: u64,
pub kve_type: u32,
pub kve_flags: u32,
pub kve_count: u32,
pub kve_wired_count: u32,
pub kve_advice: u32,
pub kve_attributes: u32,
pub kve_protection: u32,
pub kve_max_protection: u32,
pub kve_ref_count: u32,
pub kve_inheritance: u32,
pub kve_vn_fileid: u64,
pub kve_vn_size: u64,
pub kve_vn_fsid: u64,
pub kve_vn_rdev: u64,
pub kve_vn_type: u32,
pub kve_vn_mode: u32,
pub kve_path: [[::c_char; 32]; 32],
}
pub struct __c_anonymous_posix_spawn_fae_open {
pub path: *mut ::c_char,
pub oflag: ::c_int,
pub mode: ::mode_t,
}
pub struct __c_anonymous_posix_spawn_fae_dup2 {
pub newfildes: ::c_int,
}
pub struct posix_spawnattr_t {
pub sa_flags: ::c_short,
pub sa_pgroup: ::pid_t,
pub sa_schedparam: ::sched_param,
pub sa_schedpolicy: ::c_int,
pub sa_sigdefault: sigset_t,
pub sa_sigmask: sigset_t,
}
pub struct posix_spawn_file_actions_entry_t {
pub fae_action: fae_action,
pub fae_fildes: ::c_int,
#[cfg(libc_union)]
pub fae_data: __c_anonymous_posix_spawn_fae,
}
pub struct posix_spawn_file_actions_t {
pub size: ::c_uint,
pub len: ::c_uint,
#[cfg(libc_union)]
pub fae: *mut posix_spawn_file_actions_entry_t,
}
pub struct ptrace_lwpinfo {
pub pl_lwpid: lwpid_t,
pub pl_event: ::c_int,
}
pub struct ptrace_lwpstatus {
pub pl_lwpid: lwpid_t,
pub pl_sigpend: sigset_t,
pub pl_sigmask: sigset_t,
pub pl_name: [::c_char; 20],
pub pl_private: *mut ::c_void,
}
pub struct ptrace_siginfo {
pub psi_siginfo: siginfo_t,
pub psi_lwpid: lwpid_t,
}
pub struct ptrace_event {
pub pe_set_event: ::c_int,
}
pub struct sysctldesc {
pub descr_num: i32,
pub descr_ver: u32,
pub descr_len: u32,
pub descr_str: [::c_char; 1],
}
pub struct ifreq {
pub _priv: [[::c_char; 6]; 24],
}
pub struct ifconf {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
}
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
pub __tcpi_retransmits: u8,
pub __tcpi_probes: u8,
pub __tcpi_backoff: u8,
pub tcpi_options: u8,
pub tcp_snd_wscale: u8,
pub tcp_rcv_wscale: u8,
pub tcpi_rto: u32,
pub __tcpi_ato: u32,
pub tcpi_snd_mss: u32,
pub tcpi_rcv_mss: u32,
pub __tcpi_unacked: u32,
pub __tcpi_sacked: u32,
pub __tcpi_lost: u32,
pub __tcpi_retrans: u32,
pub __tcpi_fackets: u32,
pub __tcpi_last_data_sent: u32,
pub __tcpi_last_ack_sent: u32,
pub tcpi_last_data_recv: u32,
pub __tcpi_last_ack_recv: u32,
pub __tcpi_pmtu: u32,
pub __tcpi_rcv_ssthresh: u32,
pub tcpi_rtt: u32,
pub tcpi_rttvar: u32,
pub tcpi_snd_ssthresh: u32,
pub tcpi_snd_cwnd: u32,
pub __tcpi_advmss: u32,
pub __tcpi_reordering: u32,
pub __tcpi_rcv_rtt: u32,
pub tcpi_rcv_space: u32,
pub tcpi_snd_wnd: u32,
pub tcpi_snd_bwnd: u32,
pub tcpi_snd_nxt: u32,
pub tcpi_rcv_nxt: u32,
pub tcpi_toe_tid: u32,
pub tcpi_snd_rexmitpack: u32,
pub tcpi_rcv_ooopack: u32,
pub tcpi_snd_zerowin: u32,
pub __tcpi_pad: [u32; 26],
}
}
s_no_extra_traits! {
pub struct utmpx {
pub ut_name: [::c_char; _UTX_USERSIZE],
pub ut_id: [::c_char; _UTX_IDSIZE],
pub ut_line: [::c_char; _UTX_LINESIZE],
pub ut_host: [::c_char; _UTX_HOSTSIZE],
pub ut_session: u16,
pub ut_type: u16,
pub ut_pid: ::pid_t,
pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported
pub ut_ss: sockaddr_storage,
pub ut_tv: ::timeval,
pub ut_pad: [u8; _UTX_PADSIZE],
}
pub struct lastlogx {
pub ll_tv: ::timeval,
pub ll_line: [::c_char; _UTX_LINESIZE],
pub ll_host: [::c_char; _UTX_HOSTSIZE],
pub ll_ss: sockaddr_storage,
}
pub struct in_pktinfo {
pub ipi_addr: ::in_addr,
pub ipi_ifindex: ::c_uint,
}
pub struct arphdr {
pub ar_hrd: u16,
pub ar_pro: u16,
pub ar_hln: u8,
pub ar_pln: u8,
pub ar_op: u16,
}
pub struct in_addr {
pub s_addr: ::in_addr_t,
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: ::sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [i8; 8],
}
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_reclen: u16,
pub d_namlen: u16,
pub d_type: u8,
pub d_name: [::c_char; 512],
}
pub struct statvfs {
pub f_flag: ::c_ulong,
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_iosize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_bresvd: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fresvd: ::fsfilcnt_t,
pub f_syncreads: u64,
pub f_syncwrites: u64,
pub f_asyncreads: u64,
pub f_asyncwrites: u64,
pub f_fsidx: ::fsid_t,
pub f_fsid: ::c_ulong,
pub f_namemax: ::c_ulong,
pub f_owner: ::uid_t,
pub f_spare: [u32; 4],
pub f_fstypename: [::c_char; 32],
pub f_mntonname: [::c_char; 1024],
pub f_mntfromname: [::c_char; 1024],
}
pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: ::sa_family_t,
__ss_pad1: [u8; 6],
__ss_pad2: i64,
__ss_pad3: [u8; 112],
}
pub struct sigevent {
pub sigev_notify: ::c_int,
pub sigev_signo: ::c_int,
pub sigev_value: ::sigval,
__unused1: *mut ::c_void, //actually a function pointer
pub sigev_notify_attributes: *mut ::c_void
}
#[cfg(libc_union)]
pub union __c_anonymous_posix_spawn_fae {
pub open: __c_anonymous_posix_spawn_fae_open,
pub dup2: __c_anonymous_posix_spawn_fae_dup2,
}
#[cfg(libc_union)]
pub union __c_anonymous_ifc_ifcu {
pub ifcu_buf: *mut ::c_void,
pub ifcu_req: *mut ifreq,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for utmpx {
fn eq(&self, other: &utmpx) -> bool {
self.ut_type == other.ut_type
&& self.ut_pid == other.ut_pid
&& self.ut_name == other.ut_name
&& self.ut_line == other.ut_line
&& self.ut_id == other.ut_id
&& self.ut_exit == other.ut_exit
&& self.ut_session == other.ut_session
&& self.ut_tv == other.ut_tv
&& self.ut_ss == other.ut_ss
&& self
.ut_pad
.iter()
.zip(other.ut_pad.iter())
.all(|(a,b)| a == b)
&& self
.ut_host
.iter()
.zip(other.ut_host.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for utmpx {}
impl ::fmt::Debug for utmpx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("utmpx")
.field("ut_name", &self.ut_name)
.field("ut_id", &self.ut_id)
.field("ut_line", &self.ut_line)
// FIXME .field("ut_host", &self.ut_host)
.field("ut_session", &self.ut_session)
.field("ut_type", &self.ut_type)
.field("ut_pid", &self.ut_pid)
.field("ut_exit", &self.ut_exit)
.field("ut_ss", &self.ut_ss)
.field("ut_tv", &self.ut_tv)
// FIXME .field("ut_pad", &self.ut_pad)
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash(&self, state: &mut H) {
self.ut_name.hash(state);
self.ut_type.hash(state);
self.ut_pid.hash(state);
self.ut_line.hash(state);
self.ut_id.hash(state);
self.ut_host.hash(state);
self.ut_exit.hash(state);
self.ut_session.hash(state);
self.ut_tv.hash(state);
self.ut_ss.hash(state);
self.ut_pad.hash(state);
}
}
impl PartialEq for lastlogx {
fn eq(&self, other: &lastlogx) -> bool {
self.ll_tv == other.ll_tv
&& self.ll_line == other.ll_line
&& self.ll_ss == other.ll_ss
&& self
.ll_host
.iter()
.zip(other.ll_host.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for lastlogx {}
impl ::fmt::Debug for lastlogx {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("lastlogx")
.field("ll_tv", &self.ll_tv)
.field("ll_line", &self.ll_line)
// FIXME.field("ll_host", &self.ll_host)
.field("ll_ss", &self.ll_ss)
.finish()
}
}
impl ::hash::Hash for lastlogx {
fn hash(&self, state: &mut H) {
self.ll_tv.hash(state);
self.ll_line.hash(state);
self.ll_host.hash(state);
self.ll_ss.hash(state);
}
}
impl PartialEq for in_pktinfo {
fn eq(&self, other: &in_pktinfo) -> bool {
self.ipi_addr == other.ipi_addr
&& self.ipi_ifindex == other.ipi_ifindex
}
}
impl Eq for in_pktinfo {}
impl ::fmt::Debug for in_pktinfo {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("in_pktinfo")
.field("ipi_addr", &self.ipi_addr)
.field("ipi_ifindex", &self.ipi_ifindex)
.finish()
}
}
impl ::hash::Hash for in_pktinfo {
fn hash(&self, state: &mut H) {
self.ipi_addr.hash(state);
self.ipi_ifindex.hash(state);
}
}
impl PartialEq for arphdr {
fn eq(&self, other: &arphdr) -> bool {
self.ar_hrd == other.ar_hrd
&& self.ar_pro == other.ar_pro
&& self.ar_hln == other.ar_hln
&& self.ar_pln == other.ar_pln
&& self.ar_op == other.ar_op
}
}
impl Eq for arphdr {}
impl ::fmt::Debug for arphdr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let ar_hrd = self.ar_hrd;
let ar_pro = self.ar_pro;
let ar_op = self.ar_op;
f.debug_struct("arphdr")
.field("ar_hrd", &ar_hrd)
.field("ar_pro", &ar_pro)
.field("ar_hln", &self.ar_hln)
.field("ar_pln", &self.ar_pln)
.field("ar_op", &ar_op)
.finish()
}
}
impl ::hash::Hash for arphdr {
fn hash(&self, state: &mut H) {
let ar_hrd = self.ar_hrd;
let ar_pro = self.ar_pro;
let ar_op = self.ar_op;
ar_hrd.hash(state);
ar_pro.hash(state);
self.ar_hln.hash(state);
self.ar_pln.hash(state);
ar_op.hash(state);
}
}
impl PartialEq for in_addr {
fn eq(&self, other: &in_addr) -> bool {
self.s_addr == other.s_addr
}
}
impl Eq for in_addr {}
impl ::fmt::Debug for in_addr {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let s_addr = self.s_addr;
f.debug_struct("in_addr")
.field("s_addr", &s_addr)
.finish()
}
}
impl ::hash::Hash for in_addr {
fn hash(&self, state: &mut H) {
let s_addr = self.s_addr;
s_addr.hash(state);
}
}
impl PartialEq for ip_mreq {
fn eq(&self, other: &ip_mreq) -> bool {
self.imr_multiaddr == other.imr_multiaddr
&& self.imr_interface == other.imr_interface
}
}
impl Eq for ip_mreq {}
impl ::fmt::Debug for ip_mreq {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("ip_mreq")
.field("imr_multiaddr", &self.imr_multiaddr)
.field("imr_interface", &self.imr_interface)
.finish()
}
}
impl ::hash::Hash for ip_mreq {
fn hash(&self, state: &mut H) {
self.imr_multiaddr.hash(state);
self.imr_interface.hash(state);
}
}
impl PartialEq for sockaddr_in {
fn eq(&self, other: &sockaddr_in) -> bool {
self.sin_len == other.sin_len
&& self.sin_family == other.sin_family
&& self.sin_port == other.sin_port
&& self.sin_addr == other.sin_addr
&& self.sin_zero == other.sin_zero
}
}
impl Eq for sockaddr_in {}
impl ::fmt::Debug for sockaddr_in {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_in")
.field("sin_len", &self.sin_len)
.field("sin_family", &self.sin_family)
.field("sin_port", &self.sin_port)
.field("sin_addr", &self.sin_addr)
.field("sin_zero", &self.sin_zero)
.finish()
}
}
impl ::hash::Hash for sockaddr_in {
fn hash(&self, state: &mut H) {
self.sin_len.hash(state);
self.sin_family.hash(state);
self.sin_port.hash(state);
self.sin_addr.hash(state);
self.sin_zero.hash(state);
}
}
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_reclen == other.d_reclen
&& self.d_namlen == other.d_namlen
&& self.d_type == other.d_type
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_reclen", &self.d_reclen)
.field("d_namlen", &self.d_namlen)
.field("d_type", &self.d_type)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_reclen.hash(state);
self.d_namlen.hash(state);
self.d_type.hash(state);
self.d_name.hash(state);
}
}
impl PartialEq for statvfs {
fn eq(&self, other: &statvfs) -> bool {
self.f_flag == other.f_flag
&& self.f_bsize == other.f_bsize
&& self.f_frsize == other.f_frsize
&& self.f_iosize == other.f_iosize
&& self.f_blocks == other.f_blocks
&& self.f_bfree == other.f_bfree
&& self.f_bavail == other.f_bavail
&& self.f_bresvd == other.f_bresvd
&& self.f_files == other.f_files
&& self.f_ffree == other.f_ffree
&& self.f_favail == other.f_favail
&& self.f_fresvd == other.f_fresvd
&& self.f_syncreads == other.f_syncreads
&& self.f_syncwrites == other.f_syncwrites
&& self.f_asyncreads == other.f_asyncreads
&& self.f_asyncwrites == other.f_asyncwrites
&& self.f_fsidx == other.f_fsidx
&& self.f_fsid == other.f_fsid
&& self.f_namemax == other.f_namemax
&& self.f_owner == other.f_owner
&& self.f_spare == other.f_spare
&& self.f_fstypename == other.f_fstypename
&& self
.f_mntonname
.iter()
.zip(other.f_mntonname.iter())
.all(|(a,b)| a == b)
&& self
.f_mntfromname
.iter()
.zip(other.f_mntfromname.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for statvfs {}
impl ::fmt::Debug for statvfs {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("statvfs")
.field("f_flag", &self.f_flag)
.field("f_bsize", &self.f_bsize)
.field("f_frsize", &self.f_frsize)
.field("f_iosize", &self.f_iosize)
.field("f_blocks", &self.f_blocks)
.field("f_bfree", &self.f_bfree)
.field("f_bavail", &self.f_bavail)
.field("f_bresvd", &self.f_bresvd)
.field("f_files", &self.f_files)
.field("f_ffree", &self.f_ffree)
.field("f_favail", &self.f_favail)
.field("f_fresvd", &self.f_fresvd)
.field("f_syncreads", &self.f_syncreads)
.field("f_syncwrites", &self.f_syncwrites)
.field("f_asyncreads", &self.f_asyncreads)
.field("f_asyncwrites", &self.f_asyncwrites)
.field("f_fsidx", &self.f_fsidx)
.field("f_fsid", &self.f_fsid)
.field("f_namemax", &self.f_namemax)
.field("f_owner", &self.f_owner)
.field("f_spare", &self.f_spare)
.field("f_fstypename", &self.f_fstypename)
// FIXME: .field("f_mntonname", &self.f_mntonname)
// FIXME: .field("f_mntfromname", &self.f_mntfromname)
.finish()
}
}
impl ::hash::Hash for statvfs {
fn hash(&self, state: &mut H) {
self.f_flag.hash(state);
self.f_bsize.hash(state);
self.f_frsize.hash(state);
self.f_iosize.hash(state);
self.f_blocks.hash(state);
self.f_bfree.hash(state);
self.f_bavail.hash(state);
self.f_bresvd.hash(state);
self.f_files.hash(state);
self.f_ffree.hash(state);
self.f_favail.hash(state);
self.f_fresvd.hash(state);
self.f_syncreads.hash(state);
self.f_syncwrites.hash(state);
self.f_asyncreads.hash(state);
self.f_asyncwrites.hash(state);
self.f_fsidx.hash(state);
self.f_fsid.hash(state);
self.f_namemax.hash(state);
self.f_owner.hash(state);
self.f_spare.hash(state);
self.f_fstypename.hash(state);
self.f_mntonname.hash(state);
self.f_mntfromname.hash(state);
}
}
impl PartialEq for sockaddr_storage {
fn eq(&self, other: &sockaddr_storage) -> bool {
self.ss_len == other.ss_len
&& self.ss_family == other.ss_family
&& self.__ss_pad1 == other.__ss_pad1
&& self.__ss_pad2 == other.__ss_pad2
&& self
.__ss_pad3
.iter()
.zip(other.__ss_pad3.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for sockaddr_storage {}
impl ::fmt::Debug for sockaddr_storage {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_storage")
.field("ss_len", &self.ss_len)
.field("ss_family", &self.ss_family)
.field("__ss_pad1", &self.__ss_pad1)
.field("__ss_pad2", &self.__ss_pad2)
// FIXME: .field("__ss_pad3", &self.__ss_pad3)
.finish()
}
}
impl ::hash::Hash for sockaddr_storage {
fn hash(&self, state: &mut H) {
self.ss_len.hash(state);
self.ss_family.hash(state);
self.__ss_pad1.hash(state);
self.__ss_pad2.hash(state);
self.__ss_pad3.hash(state);
}
}
impl PartialEq for sigevent {
fn eq(&self, other: &sigevent) -> bool {
self.sigev_notify == other.sigev_notify
&& self.sigev_signo == other.sigev_signo
&& self.sigev_value == other.sigev_value
&& self.sigev_notify_attributes
== other.sigev_notify_attributes
}
}
impl Eq for sigevent {}
impl ::fmt::Debug for sigevent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sigevent")
.field("sigev_notify", &self.sigev_notify)
.field("sigev_signo", &self.sigev_signo)
.field("sigev_value", &self.sigev_value)
.field("sigev_notify_attributes",
&self.sigev_notify_attributes)
.finish()
}
}
impl ::hash::Hash for sigevent {
fn hash(&self, state: &mut H) {
self.sigev_notify.hash(state);
self.sigev_signo.hash(state);
self.sigev_value.hash(state);
self.sigev_notify_attributes.hash(state);
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_posix_spawn_fae {}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_posix_spawn_fae {
fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool {
unsafe {
self.open == other.open
|| self.dup2 == other.dup2
}
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_posix_spawn_fae {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
f.debug_struct("__c_anonymous_posix_fae")
.field("open", &self.open)
.field("dup2", &self.dup2)
.finish()
}
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_posix_spawn_fae {
fn hash(&self, state: &mut H) {
unsafe {
self.open.hash(state);
self.dup2.hash(state);
}
}
}
#[cfg(libc_union)]
impl Eq for __c_anonymous_ifc_ifcu {}
#[cfg(libc_union)]
impl PartialEq for __c_anonymous_ifc_ifcu {
fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool {
unsafe {
self.ifcu_buf == other.ifcu_buf
|| self.ifcu_req == other.ifcu_req
}
}
}
#[cfg(libc_union)]
impl ::fmt::Debug for __c_anonymous_ifc_ifcu {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
unsafe {
f.debug_struct("__c_anonymous_ifc_ifcu")
.field("ifcu_buf", &self.ifcu_buf)
.field("ifcu_req", &self.ifcu_req)
.finish()
}
}
}
#[cfg(libc_union)]
impl ::hash::Hash for __c_anonymous_ifc_ifcu {
fn hash(&self, state: &mut H) {
unsafe {
self.ifcu_buf.hash(state);
self.ifcu_req.hash(state);
}
}
}
}
}
pub const AT_FDCWD: ::c_int = -100;
pub const AT_EACCESS: ::c_int = 0x100;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
pub const AT_NULL: ::c_int = 0;
pub const AT_IGNORE: ::c_int = 1;
pub const AT_EXECFD: ::c_int = 2;
pub const AT_PHDR: ::c_int = 3;
pub const AT_PHENT: ::c_int = 4;
pub const AT_PHNUM: ::c_int = 5;
pub const AT_PAGESZ: ::c_int = 6;
pub const AT_BASE: ::c_int = 7;
pub const AT_FLAGS: ::c_int = 8;
pub const AT_ENTRY: ::c_int = 9;
pub const AT_DCACHEBSIZE: ::c_int = 10;
pub const AT_ICACHEBSIZE: ::c_int = 11;
pub const AT_UCACHEBSIZE: ::c_int = 12;
pub const AT_STACKBASE: ::c_int = 13;
pub const AT_EUID: ::c_int = 2000;
pub const AT_RUID: ::c_int = 2001;
pub const AT_EGID: ::c_int = 2002;
pub const AT_RGID: ::c_int = 2003;
pub const AT_SUN_LDELF: ::c_int = 2004;
pub const AT_SUN_LDSHDR: ::c_int = 2005;
pub const AT_SUN_LDNAME: ::c_int = 2006;
pub const AT_SUN_LDPGSIZE: ::c_int = 2007;
pub const AT_SUN_PLATFORM: ::c_int = 2008;
pub const AT_SUN_HWCAP: ::c_int = 2009;
pub const AT_SUN_IFLUSH: ::c_int = 2010;
pub const AT_SUN_CPU: ::c_int = 2011;
pub const AT_SUN_EMUL_ENTRY: ::c_int = 2012;
pub const AT_SUN_EMUL_EXECFD: ::c_int = 2013;
pub const AT_SUN_EXECNAME: ::c_int = 2014;
pub const EXTATTR_NAMESPACE_USER: ::c_int = 1;
pub const EXTATTR_NAMESPACE_SYSTEM: ::c_int = 2;
pub const LC_COLLATE_MASK: ::c_int = 1 << ::LC_COLLATE;
pub const LC_CTYPE_MASK: ::c_int = 1 << ::LC_CTYPE;
pub const LC_MONETARY_MASK: ::c_int = 1 << ::LC_MONETARY;
pub const LC_NUMERIC_MASK: ::c_int = 1 << ::LC_NUMERIC;
pub const LC_TIME_MASK: ::c_int = 1 << ::LC_TIME;
pub const LC_MESSAGES_MASK: ::c_int = 1 << ::LC_MESSAGES;
pub const LC_ALL_MASK: ::c_int = !0;
pub const ERA: ::nl_item = 52;
pub const ERA_D_FMT: ::nl_item = 53;
pub const ERA_D_T_FMT: ::nl_item = 54;
pub const ERA_T_FMT: ::nl_item = 55;
pub const ALT_DIGITS: ::nl_item = 56;
pub const O_CLOEXEC: ::c_int = 0x400000;
pub const O_ALT_IO: ::c_int = 0x40000;
pub const O_NOSIGPIPE: ::c_int = 0x1000000;
pub const O_SEARCH: ::c_int = 0x800000;
pub const O_DIRECTORY: ::c_int = 0x200000;
pub const O_DIRECT: ::c_int = 0x00080000;
pub const O_RSYNC: ::c_int = 0x00020000;
pub const MS_SYNC: ::c_int = 0x4;
pub const MS_INVALIDATE: ::c_int = 0x2;
// Here because they are not present on OpenBSD
// (https://github.com/openbsd/src/blob/HEAD/sys/sys/resource.h)
pub const RLIMIT_SBSIZE: ::c_int = 9;
pub const RLIMIT_AS: ::c_int = 10;
pub const RLIMIT_NTHR: ::c_int = 11;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 12;
pub const EIDRM: ::c_int = 82;
pub const ENOMSG: ::c_int = 83;
pub const EOVERFLOW: ::c_int = 84;
pub const EILSEQ: ::c_int = 85;
pub const ENOTSUP: ::c_int = 86;
pub const ECANCELED: ::c_int = 87;
pub const EBADMSG: ::c_int = 88;
pub const ENODATA: ::c_int = 89;
pub const ENOSR: ::c_int = 90;
pub const ENOSTR: ::c_int = 91;
pub const ETIME: ::c_int = 92;
pub const ENOATTR: ::c_int = 93;
pub const EMULTIHOP: ::c_int = 94;
pub const ENOLINK: ::c_int = 95;
pub const EPROTO: ::c_int = 96;
pub const EOWNERDEAD: ::c_int = 97;
pub const ENOTRECOVERABLE: ::c_int = 98;
#[deprecated(
since = "0.2.143",
note = "This value will always match the highest defined error number \
and thus is not stable. \
See #3040 for more info."
)]
pub const ELAST: ::c_int = 98;
pub const F_DUPFD_CLOEXEC: ::c_int = 12;
pub const F_CLOSEM: ::c_int = 10;
pub const F_GETNOSIGPIPE: ::c_int = 13;
pub const F_SETNOSIGPIPE: ::c_int = 14;
pub const F_MAXFD: ::c_int = 11;
pub const F_GETPATH: ::c_int = 15;
pub const FUTEX_WAIT: ::c_int = 0;
pub const FUTEX_WAKE: ::c_int = 1;
pub const FUTEX_FD: ::c_int = 2;
pub const FUTEX_REQUEUE: ::c_int = 3;
pub const FUTEX_CMP_REQUEUE: ::c_int = 4;
pub const FUTEX_WAKE_OP: ::c_int = 5;
pub const FUTEX_LOCK_PI: ::c_int = 6;
pub const FUTEX_UNLOCK_PI: ::c_int = 7;
pub const FUTEX_TRYLOCK_PI: ::c_int = 8;
pub const FUTEX_WAIT_BITSET: ::c_int = 9;
pub const FUTEX_WAKE_BITSET: ::c_int = 10;
pub const FUTEX_WAIT_REQUEUE_PI: ::c_int = 11;
pub const FUTEX_CMP_REQUEUE_PI: ::c_int = 12;
pub const FUTEX_PRIVATE_FLAG: ::c_int = 1 << 7;
pub const FUTEX_CLOCK_REALTIME: ::c_int = 1 << 8;
pub const FUTEX_CMD_MASK: ::c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME);
pub const FUTEX_WAITERS: u32 = 1 << 31;
pub const FUTEX_OWNER_DIED: u32 = 1 << 30;
pub const FUTEX_SYNCOBJ_1: u32 = 1 << 29;
pub const FUTEX_SYNCOBJ_0: u32 = 1 << 28;
pub const FUTEX_TID_MASK: u32 = (1 << 28) - 1;
pub const FUTEX_BITSET_MATCH_ANY: u32 = !0;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
pub const IP_RECVIF: ::c_int = 20;
pub const IP_PKTINFO: ::c_int = 25;
pub const IP_RECVPKTINFO: ::c_int = 26;
pub const IPV6_JOIN_GROUP: ::c_int = 12;
pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const TCP_KEEPIDLE: ::c_int = 3;
pub const TCP_KEEPINTVL: ::c_int = 5;
pub const TCP_KEEPCNT: ::c_int = 6;
pub const TCP_KEEPINIT: ::c_int = 7;
pub const TCP_MD5SIG: ::c_int = 0x10;
pub const TCP_CONGCTL: ::c_int = 0x20;
pub const SOCK_CONN_DGRAM: ::c_int = 6;
pub const SOCK_DCCP: ::c_int = SOCK_CONN_DGRAM;
pub const SOCK_NOSIGPIPE: ::c_int = 0x40000000;
pub const SOCK_FLAGS_MASK: ::c_int = 0xf0000000;
pub const SO_SNDTIMEO: ::c_int = 0x100b;
pub const SO_RCVTIMEO: ::c_int = 0x100c;
pub const SO_NOSIGPIPE: ::c_int = 0x0800;
pub const SO_ACCEPTFILTER: ::c_int = 0x1000;
pub const SO_TIMESTAMP: ::c_int = 0x2000;
pub const SO_OVERFLOWED: ::c_int = 0x1009;
pub const SO_NOHEADER: ::c_int = 0x100a;
// http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h?annotate
pub const LOCAL_OCREDS: ::c_int = 0x0001; // pass credentials to receiver
pub const LOCAL_CONNWAIT: ::c_int = 0x0002; // connects block until accepted
pub const LOCAL_PEEREID: ::c_int = 0x0003; // get peer identification
pub const LOCAL_CREDS: ::c_int = 0x0004; // pass credentials to receiver
// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
pub const IFF_UP: ::c_int = 0x0001; // interface is up
pub const IFF_BROADCAST: ::c_int = 0x0002; // broadcast address valid
pub const IFF_DEBUG: ::c_int = 0x0004; // turn on debugging
pub const IFF_LOOPBACK: ::c_int = 0x0008; // is a loopback net
pub const IFF_POINTOPOINT: ::c_int = 0x0010; // interface is point-to-point link
pub const IFF_NOTRAILERS: ::c_int = 0x0020; // avoid use of trailers
pub const IFF_RUNNING: ::c_int = 0x0040; // resources allocated
pub const IFF_NOARP: ::c_int = 0x0080; // no address resolution protocol
pub const IFF_PROMISC: ::c_int = 0x0100; // receive all packets
pub const IFF_ALLMULTI: ::c_int = 0x0200; // receive all multicast packets
pub const IFF_OACTIVE: ::c_int = 0x0400; // transmission in progress
pub const IFF_SIMPLEX: ::c_int = 0x0800; // can't hear own transmissions
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
// sys/netinet/in.h
// Protocols (RFC 1700)
// NOTE: These are in addition to the constants defined in src/unix/mod.rs
// IPPROTO_IP defined in src/unix/mod.rs
/// Hop-by-hop option header
pub const IPPROTO_HOPOPTS: ::c_int = 0;
// IPPROTO_ICMP defined in src/unix/mod.rs
/// group mgmt protocol
pub const IPPROTO_IGMP: ::c_int = 2;
/// gateway^2 (deprecated)
pub const IPPROTO_GGP: ::c_int = 3;
/// for compatibility
pub const IPPROTO_IPIP: ::c_int = 4;
// IPPROTO_TCP defined in src/unix/mod.rs
/// exterior gateway protocol
pub const IPPROTO_EGP: ::c_int = 8;
/// pup
pub const IPPROTO_PUP: ::c_int = 12;
// IPPROTO_UDP defined in src/unix/mod.rs
/// xns idp
pub const IPPROTO_IDP: ::c_int = 22;
/// tp-4 w/ class negotiation
pub const IPPROTO_TP: ::c_int = 29;
/// DCCP
pub const IPPROTO_DCCP: ::c_int = 33;
// IPPROTO_IPV6 defined in src/unix/mod.rs
/// IP6 routing header
pub const IPPROTO_ROUTING: ::c_int = 43;
/// IP6 fragmentation header
pub const IPPROTO_FRAGMENT: ::c_int = 44;
/// resource reservation
pub const IPPROTO_RSVP: ::c_int = 46;
/// General Routing Encap.
pub const IPPROTO_GRE: ::c_int = 47;
/// IP6 Encap Sec. Payload
pub const IPPROTO_ESP: ::c_int = 50;
/// IP6 Auth Header
pub const IPPROTO_AH: ::c_int = 51;
/// IP Mobility RFC 2004
pub const IPPROTO_MOBILE: ::c_int = 55;
/// IPv6 ICMP
pub const IPPROTO_IPV6_ICMP: ::c_int = 58;
// IPPROTO_ICMPV6 defined in src/unix/mod.rs
/// IP6 no next header
pub const IPPROTO_NONE: ::c_int = 59;
/// IP6 destination option
pub const IPPROTO_DSTOPTS: ::c_int = 60;
/// ISO cnlp
pub const IPPROTO_EON: ::c_int = 80;
/// Ethernet-in-IP
pub const IPPROTO_ETHERIP: ::c_int = 97;
/// encapsulation header
pub const IPPROTO_ENCAP: ::c_int = 98;
/// Protocol indep. multicast
pub const IPPROTO_PIM: ::c_int = 103;
/// IP Payload Comp. Protocol
pub const IPPROTO_IPCOMP: ::c_int = 108;
/// VRRP RFC 2338
pub const IPPROTO_VRRP: ::c_int = 112;
/// Common Address Resolution Protocol
pub const IPPROTO_CARP: ::c_int = 112;
/// L2TPv3
pub const IPPROTO_L2TP: ::c_int = 115;
/// SCTP
pub const IPPROTO_SCTP: ::c_int = 132;
/// PFSYNC
pub const IPPROTO_PFSYNC: ::c_int = 240;
pub const IPPROTO_MAX: ::c_int = 256;
/// last return value of *_input(), meaning "all job for this pkt is done".
pub const IPPROTO_DONE: ::c_int = 257;
/// sysctl placeholder for (FAST_)IPSEC
pub const CTL_IPPROTO_IPSEC: ::c_int = 258;
pub const AF_OROUTE: ::c_int = 17;
pub const AF_ARP: ::c_int = 28;
pub const pseudo_AF_KEY: ::c_int = 29;
pub const pseudo_AF_HDRCMPLT: ::c_int = 30;
pub const AF_BLUETOOTH: ::c_int = 31;
pub const AF_IEEE80211: ::c_int = 32;
pub const AF_MPLS: ::c_int = 33;
pub const AF_ROUTE: ::c_int = 34;
pub const NET_RT_DUMP: ::c_int = 1;
pub const NET_RT_FLAGS: ::c_int = 2;
pub const NET_RT_OOOIFLIST: ::c_int = 3;
pub const NET_RT_OOIFLIST: ::c_int = 4;
pub const NET_RT_OIFLIST: ::c_int = 5;
pub const NET_RT_IFLIST: ::c_int = 6;
pub const NET_RT_MAXID: ::c_int = 7;
pub const PF_OROUTE: ::c_int = AF_OROUTE;
pub const PF_ARP: ::c_int = AF_ARP;
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_BLUETOOTH: ::c_int = AF_BLUETOOTH;
pub const PF_MPLS: ::c_int = AF_MPLS;
pub const PF_ROUTE: ::c_int = AF_ROUTE;
pub const MSG_NBIO: ::c_int = 0x1000;
pub const MSG_WAITFORONE: ::c_int = 0x2000;
pub const MSG_NOTIFICATION: ::c_int = 0x4000;
pub const SCM_TIMESTAMP: ::c_int = 0x08;
pub const SCM_CREDS: ::c_int = 0x10;
pub const O_DSYNC: ::c_int = 0x10000;
pub const MAP_RENAME: ::c_int = 0x20;
pub const MAP_NORESERVE: ::c_int = 0x40;
pub const MAP_HASSEMAPHORE: ::c_int = 0x200;
pub const MAP_TRYFIXED: ::c_int = 0x400;
pub const MAP_WIRED: ::c_int = 0x800;
pub const MAP_STACK: ::c_int = 0x2000;
// map alignment aliases for MAP_ALIGNED
pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_64KB: ::c_int = 16 << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_16MB: ::c_int = 24 << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_4GB: ::c_int = 32 << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_1TB: ::c_int = 40 << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_256TB: ::c_int = 48 << MAP_ALIGNMENT_SHIFT;
pub const MAP_ALIGNMENT_64PB: ::c_int = 56 << MAP_ALIGNMENT_SHIFT;
// mremap flag
pub const MAP_REMAPDUP: ::c_int = 0x004;
pub const DCCP_TYPE_REQUEST: ::c_int = 0;
pub const DCCP_TYPE_RESPONSE: ::c_int = 1;
pub const DCCP_TYPE_DATA: ::c_int = 2;
pub const DCCP_TYPE_ACK: ::c_int = 3;
pub const DCCP_TYPE_DATAACK: ::c_int = 4;
pub const DCCP_TYPE_CLOSEREQ: ::c_int = 5;
pub const DCCP_TYPE_CLOSE: ::c_int = 6;
pub const DCCP_TYPE_RESET: ::c_int = 7;
pub const DCCP_TYPE_MOVE: ::c_int = 8;
pub const DCCP_FEATURE_CC: ::c_int = 1;
pub const DCCP_FEATURE_ECN: ::c_int = 2;
pub const DCCP_FEATURE_ACKRATIO: ::c_int = 3;
pub const DCCP_FEATURE_ACKVECTOR: ::c_int = 4;
pub const DCCP_FEATURE_MOBILITY: ::c_int = 5;
pub const DCCP_FEATURE_LOSSWINDOW: ::c_int = 6;
pub const DCCP_FEATURE_CONN_NONCE: ::c_int = 8;
pub const DCCP_FEATURE_IDENTREG: ::c_int = 7;
pub const DCCP_OPT_PADDING: ::c_int = 0;
pub const DCCP_OPT_DATA_DISCARD: ::c_int = 1;
pub const DCCP_OPT_SLOW_RECV: ::c_int = 2;
pub const DCCP_OPT_BUF_CLOSED: ::c_int = 3;
pub const DCCP_OPT_CHANGE_L: ::c_int = 32;
pub const DCCP_OPT_CONFIRM_L: ::c_int = 33;
pub const DCCP_OPT_CHANGE_R: ::c_int = 34;
pub const DCCP_OPT_CONFIRM_R: ::c_int = 35;
pub const DCCP_OPT_INIT_COOKIE: ::c_int = 36;
pub const DCCP_OPT_NDP_COUNT: ::c_int = 37;
pub const DCCP_OPT_ACK_VECTOR0: ::c_int = 38;
pub const DCCP_OPT_ACK_VECTOR1: ::c_int = 39;
pub const DCCP_OPT_RECV_BUF_DROPS: ::c_int = 40;
pub const DCCP_OPT_TIMESTAMP: ::c_int = 41;
pub const DCCP_OPT_TIMESTAMP_ECHO: ::c_int = 42;
pub const DCCP_OPT_ELAPSEDTIME: ::c_int = 43;
pub const DCCP_OPT_DATACHECKSUM: ::c_int = 44;
pub const DCCP_REASON_UNSPEC: ::c_int = 0;
pub const DCCP_REASON_CLOSED: ::c_int = 1;
pub const DCCP_REASON_INVALID: ::c_int = 2;
pub const DCCP_REASON_OPTION_ERR: ::c_int = 3;
pub const DCCP_REASON_FEA_ERR: ::c_int = 4;
pub const DCCP_REASON_CONN_REF: ::c_int = 5;
pub const DCCP_REASON_BAD_SNAME: ::c_int = 6;
pub const DCCP_REASON_BAD_COOKIE: ::c_int = 7;
pub const DCCP_REASON_INV_MOVE: ::c_int = 8;
pub const DCCP_REASON_UNANSW_CH: ::c_int = 10;
pub const DCCP_REASON_FRUITLESS_NEG: ::c_int = 11;
pub const DCCP_CCID: ::c_int = 1;
pub const DCCP_CSLEN: ::c_int = 2;
pub const DCCP_MAXSEG: ::c_int = 4;
pub const DCCP_SERVICE: ::c_int = 8;
pub const DCCP_NDP_LIMIT: ::c_int = 16;
pub const DCCP_SEQ_NUM_LIMIT: ::c_int = 16777216;
pub const DCCP_MAX_OPTIONS: ::c_int = 32;
pub const DCCP_MAX_PKTS: ::c_int = 100;
pub const _PC_LINK_MAX: ::c_int = 1;
pub const _PC_MAX_CANON: ::c_int = 2;
pub const _PC_MAX_INPUT: ::c_int = 3;
pub const _PC_NAME_MAX: ::c_int = 4;
pub const _PC_PATH_MAX: ::c_int = 5;
pub const _PC_PIPE_BUF: ::c_int = 6;
pub const _PC_CHOWN_RESTRICTED: ::c_int = 7;
pub const _PC_NO_TRUNC: ::c_int = 8;
pub const _PC_VDISABLE: ::c_int = 9;
pub const _PC_SYNC_IO: ::c_int = 10;
pub const _PC_FILESIZEBITS: ::c_int = 11;
pub const _PC_SYMLINK_MAX: ::c_int = 12;
pub const _PC_2_SYMLINKS: ::c_int = 13;
pub const _PC_ACL_EXTENDED: ::c_int = 14;
pub const _PC_MIN_HOLE_SIZE: ::c_int = 15;
pub const _SC_SYNCHRONIZED_IO: ::c_int = 31;
pub const _SC_IOV_MAX: ::c_int = 32;
pub const _SC_MAPPED_FILES: ::c_int = 33;
pub const _SC_MEMLOCK: ::c_int = 34;
pub const _SC_MEMLOCK_RANGE: ::c_int = 35;
pub const _SC_MEMORY_PROTECTION: ::c_int = 36;
pub const _SC_LOGIN_NAME_MAX: ::c_int = 37;
pub const _SC_MONOTONIC_CLOCK: ::c_int = 38;
pub const _SC_CLK_TCK: ::c_int = 39;
pub const _SC_ATEXIT_MAX: ::c_int = 40;
pub const _SC_THREADS: ::c_int = 41;
pub const _SC_SEMAPHORES: ::c_int = 42;
pub const _SC_BARRIERS: ::c_int = 43;
pub const _SC_TIMERS: ::c_int = 44;
pub const _SC_SPIN_LOCKS: ::c_int = 45;
pub const _SC_READER_WRITER_LOCKS: ::c_int = 46;
pub const _SC_GETGR_R_SIZE_MAX: ::c_int = 47;
pub const _SC_GETPW_R_SIZE_MAX: ::c_int = 48;
pub const _SC_CLOCK_SELECTION: ::c_int = 49;
pub const _SC_ASYNCHRONOUS_IO: ::c_int = 50;
pub const _SC_AIO_LISTIO_MAX: ::c_int = 51;
pub const _SC_AIO_MAX: ::c_int = 52;
pub const _SC_MESSAGE_PASSING: ::c_int = 53;
pub const _SC_MQ_OPEN_MAX: ::c_int = 54;
pub const _SC_MQ_PRIO_MAX: ::c_int = 55;
pub const _SC_PRIORITY_SCHEDULING: ::c_int = 56;
pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: ::c_int = 57;
pub const _SC_THREAD_KEYS_MAX: ::c_int = 58;
pub const _SC_THREAD_STACK_MIN: ::c_int = 59;
pub const _SC_THREAD_THREADS_MAX: ::c_int = 60;
pub const _SC_THREAD_ATTR_STACKADDR: ::c_int = 61;
pub const _SC_THREAD_ATTR_STACKSIZE: ::c_int = 62;
pub const _SC_THREAD_PRIORITY_SCHEDULING: ::c_int = 63;
pub const _SC_THREAD_PRIO_INHERIT: ::c_int = 64;
pub const _SC_THREAD_PRIO_PROTECT: ::c_int = 65;
pub const _SC_THREAD_PROCESS_SHARED: ::c_int = 66;
pub const _SC_THREAD_SAFE_FUNCTIONS: ::c_int = 67;
pub const _SC_TTY_NAME_MAX: ::c_int = 68;
pub const _SC_HOST_NAME_MAX: ::c_int = 69;
pub const _SC_PASS_MAX: ::c_int = 70;
pub const _SC_REGEXP: ::c_int = 71;
pub const _SC_SHELL: ::c_int = 72;
pub const _SC_SYMLOOP_MAX: ::c_int = 73;
pub const _SC_V6_ILP32_OFF32: ::c_int = 74;
pub const _SC_V6_ILP32_OFFBIG: ::c_int = 75;
pub const _SC_V6_LP64_OFF64: ::c_int = 76;
pub const _SC_V6_LPBIG_OFFBIG: ::c_int = 77;
pub const _SC_2_PBS: ::c_int = 80;
pub const _SC_2_PBS_ACCOUNTING: ::c_int = 81;
pub const _SC_2_PBS_CHECKPOINT: ::c_int = 82;
pub const _SC_2_PBS_LOCATE: ::c_int = 83;
pub const _SC_2_PBS_MESSAGE: ::c_int = 84;
pub const _SC_2_PBS_TRACK: ::c_int = 85;
pub const _SC_SPAWN: ::c_int = 86;
pub const _SC_SHARED_MEMORY_OBJECTS: ::c_int = 87;
pub const _SC_TIMER_MAX: ::c_int = 88;
pub const _SC_SEM_NSEMS_MAX: ::c_int = 89;
pub const _SC_CPUTIME: ::c_int = 90;
pub const _SC_THREAD_CPUTIME: ::c_int = 91;
pub const _SC_DELAYTIMER_MAX: ::c_int = 92;
// These two variables will be supported in NetBSD 8.0
// pub const _SC_SIGQUEUE_MAX : ::c_int = 93;
// pub const _SC_REALTIME_SIGNALS : ::c_int = 94;
pub const _SC_PHYS_PAGES: ::c_int = 121;
pub const _SC_NPROCESSORS_CONF: ::c_int = 1001;
pub const _SC_NPROCESSORS_ONLN: ::c_int = 1002;
pub const _SC_SCHED_RT_TS: ::c_int = 2001;
pub const _SC_SCHED_PRI_MIN: ::c_int = 2002;
pub const _SC_SCHED_PRI_MAX: ::c_int = 2003;
pub const FD_SETSIZE: usize = 0x100;
pub const ST_NOSUID: ::c_ulong = 8;
pub const BIOCGRSIG: ::c_ulong = 0x40044272;
pub const BIOCSRSIG: ::c_ulong = 0x80044273;
pub const BIOCSDLT: ::c_ulong = 0x80044278;
pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
//
pub const MNT_UNION: ::c_int = 0x00000020;
pub const MNT_NOCOREDUMP: ::c_int = 0x00008000;
pub const MNT_RELATIME: ::c_int = 0x00020000;
pub const MNT_IGNORE: ::c_int = 0x00100000;
pub const MNT_NFS4ACLS: ::c_int = 0x00200000;
pub const MNT_DISCARD: ::c_int = 0x00800000;
pub const MNT_EXTATTR: ::c_int = 0x01000000;
pub const MNT_LOG: ::c_int = 0x02000000;
pub const MNT_NOATIME: ::c_int = 0x04000000;
pub const MNT_AUTOMOUNTED: ::c_int = 0x10000000;
pub const MNT_SYMPERM: ::c_int = 0x20000000;
pub const MNT_NODEVMTIME: ::c_int = 0x40000000;
pub const MNT_SOFTDEP: ::c_int = 0x80000000;
pub const MNT_POSIX1EACLS: ::c_int = 0x00000800;
pub const MNT_ACLS: ::c_int = MNT_POSIX1EACLS;
pub const MNT_WAIT: ::c_int = 1;
pub const MNT_NOWAIT: ::c_int = 2;
pub const MNT_LAZY: ::c_int = 3;
//
pub const NTP_API: ::c_int = 4;
pub const MAXPHASE: ::c_long = 500000000;
pub const MAXFREQ: ::c_long = 500000;
pub const MINSEC: ::c_int = 256;
pub const MAXSEC: ::c_int = 2048;
pub const NANOSECOND: ::c_long = 1000000000;
pub const SCALE_PPM: ::c_int = 65;
pub const MAXTC: ::c_int = 10;
pub const MOD_OFFSET: ::c_uint = 0x0001;
pub const MOD_FREQUENCY: ::c_uint = 0x0002;
pub const MOD_MAXERROR: ::c_uint = 0x0004;
pub const MOD_ESTERROR: ::c_uint = 0x0008;
pub const MOD_STATUS: ::c_uint = 0x0010;
pub const MOD_TIMECONST: ::c_uint = 0x0020;
pub const MOD_PPSMAX: ::c_uint = 0x0040;
pub const MOD_TAI: ::c_uint = 0x0080;
pub const MOD_MICRO: ::c_uint = 0x1000;
pub const MOD_NANO: ::c_uint = 0x2000;
pub const MOD_CLKB: ::c_uint = 0x4000;
pub const MOD_CLKA: ::c_uint = 0x8000;
pub const STA_PLL: ::c_int = 0x0001;
pub const STA_PPSFREQ: ::c_int = 0x0002;
pub const STA_PPSTIME: ::c_int = 0x0004;
pub const STA_FLL: ::c_int = 0x0008;
pub const STA_INS: ::c_int = 0x0010;
pub const STA_DEL: ::c_int = 0x0020;
pub const STA_UNSYNC: ::c_int = 0x0040;
pub const STA_FREQHOLD: ::c_int = 0x0080;
pub const STA_PPSSIGNAL: ::c_int = 0x0100;
pub const STA_PPSJITTER: ::c_int = 0x0200;
pub const STA_PPSWANDER: ::c_int = 0x0400;
pub const STA_PPSERROR: ::c_int = 0x0800;
pub const STA_CLOCKERR: ::c_int = 0x1000;
pub const STA_NANO: ::c_int = 0x2000;
pub const STA_MODE: ::c_int = 0x4000;
pub const STA_CLK: ::c_int = 0x8000;
pub const STA_RONLY: ::c_int = STA_PPSSIGNAL
| STA_PPSJITTER
| STA_PPSWANDER
| STA_PPSERROR
| STA_CLOCKERR
| STA_NANO
| STA_MODE
| STA_CLK;
pub const TIME_OK: ::c_int = 0;
pub const TIME_INS: ::c_int = 1;
pub const TIME_DEL: ::c_int = 2;
pub const TIME_OOP: ::c_int = 3;
pub const TIME_WAIT: ::c_int = 4;
pub const TIME_ERROR: ::c_int = 5;
pub const LITTLE_ENDIAN: ::c_int = 1234;
pub const BIG_ENDIAN: ::c_int = 4321;
pub const PL_EVENT_NONE: ::c_int = 0;
pub const PL_EVENT_SIGNAL: ::c_int = 1;
pub const PL_EVENT_SUSPENDED: ::c_int = 2;
cfg_if! {
if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
target_arch = "x86", target_arch = "x86_64"))] {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
= pthread_mutex_t {
ptm_magic: 0x33330003,
ptm_errorcheck: 0,
ptm_pad1: [0; 3],
ptm_unused: 0,
ptm_pad2: [0; 3],
ptm_waiters: 0 as *mut _,
ptm_owner: 0,
ptm_recursed: 0,
ptm_spare2: 0 as *mut _,
};
} else {
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t
= pthread_mutex_t {
ptm_magic: 0x33330003,
ptm_errorcheck: 0,
ptm_unused: 0,
ptm_waiters: 0 as *mut _,
ptm_owner: 0,
ptm_recursed: 0,
ptm_spare2: 0 as *mut _,
};
}
}
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
ptc_magic: 0x55550005,
ptc_lock: 0,
ptc_waiters_first: 0 as *mut _,
ptc_waiters_last: 0 as *mut _,
ptc_mutex: 0 as *mut _,
ptc_private: 0 as *mut _,
};
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
ptr_magic: 0x99990009,
ptr_interlock: 0,
ptr_rblocked_first: 0 as *mut _,
ptr_rblocked_last: 0 as *mut _,
ptr_wblocked_first: 0 as *mut _,
ptr_wblocked_last: 0 as *mut _,
ptr_nreaders: 0,
ptr_owner: 0,
ptr_private: 0 as *mut _,
};
pub const PTHREAD_MUTEX_NORMAL: ::c_int = 0;
pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1;
pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const SCHED_NONE: ::c_int = -1;
pub const SCHED_OTHER: ::c_int = 0;
pub const SCHED_FIFO: ::c_int = 1;
pub const SCHED_RR: ::c_int = 2;
pub const EVFILT_AIO: u32 = 2;
pub const EVFILT_PROC: u32 = 4;
pub const EVFILT_READ: u32 = 0;
pub const EVFILT_SIGNAL: u32 = 5;
pub const EVFILT_TIMER: u32 = 6;
pub const EVFILT_VNODE: u32 = 3;
pub const EVFILT_WRITE: u32 = 1;
pub const EVFILT_FS: u32 = 7;
pub const EVFILT_USER: u32 = 8;
pub const EVFILT_EMPTY: u32 = 9;
pub const EV_ADD: u32 = 0x1;
pub const EV_DELETE: u32 = 0x2;
pub const EV_ENABLE: u32 = 0x4;
pub const EV_DISABLE: u32 = 0x8;
pub const EV_ONESHOT: u32 = 0x10;
pub const EV_CLEAR: u32 = 0x20;
pub const EV_RECEIPT: u32 = 0x40;
pub const EV_DISPATCH: u32 = 0x80;
pub const EV_FLAG1: u32 = 0x2000;
pub const EV_ERROR: u32 = 0x4000;
pub const EV_EOF: u32 = 0x8000;
pub const EV_SYSFLAGS: u32 = 0xf000;
pub const NOTE_TRIGGER: u32 = 0x01000000;
pub const NOTE_FFNOP: u32 = 0x00000000;
pub const NOTE_FFAND: u32 = 0x40000000;
pub const NOTE_FFOR: u32 = 0x80000000;
pub const NOTE_FFCOPY: u32 = 0xc0000000;
pub const NOTE_FFCTRLMASK: u32 = 0xc0000000;
pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff;
pub const NOTE_LOWAT: u32 = 0x00000001;
pub const NOTE_DELETE: u32 = 0x00000001;
pub const NOTE_WRITE: u32 = 0x00000002;
pub const NOTE_EXTEND: u32 = 0x00000004;
pub const NOTE_ATTRIB: u32 = 0x00000008;
pub const NOTE_LINK: u32 = 0x00000010;
pub const NOTE_RENAME: u32 = 0x00000020;
pub const NOTE_REVOKE: u32 = 0x00000040;
pub const NOTE_EXIT: u32 = 0x80000000;
pub const NOTE_FORK: u32 = 0x40000000;
pub const NOTE_EXEC: u32 = 0x20000000;
pub const NOTE_PDATAMASK: u32 = 0x000fffff;
pub const NOTE_PCTRLMASK: u32 = 0xf0000000;
pub const NOTE_TRACK: u32 = 0x00000001;
pub const NOTE_TRACKERR: u32 = 0x00000002;
pub const NOTE_CHILD: u32 = 0x00000004;
pub const NOTE_MSECONDS: u32 = 0x00000000;
pub const NOTE_SECONDS: u32 = 0x00000001;
pub const NOTE_USECONDS: u32 = 0x00000002;
pub const NOTE_NSECONDS: u32 = 0x00000003;
pub const NOTE_ABSTIME: u32 = 0x000000010;
pub const TMP_MAX: ::c_uint = 308915776;
pub const AI_PASSIVE: ::c_int = 0x00000001;
pub const AI_CANONNAME: ::c_int = 0x00000002;
pub const AI_NUMERICHOST: ::c_int = 0x00000004;
pub const AI_NUMERICSERV: ::c_int = 0x00000008;
pub const AI_ADDRCONFIG: ::c_int = 0x00000400;
pub const AI_SRV: ::c_int = 0x00000800;
pub const NI_MAXHOST: ::socklen_t = 1025;
pub const NI_MAXSERV: ::socklen_t = 32;
pub const NI_NOFQDN: ::c_int = 0x00000001;
pub const NI_NUMERICHOST: ::c_int = 0x000000002;
pub const NI_NAMEREQD: ::c_int = 0x000000004;
pub const NI_NUMERICSERV: ::c_int = 0x000000008;
pub const NI_DGRAM: ::c_int = 0x00000010;
pub const NI_WITHSCOPEID: ::c_int = 0x00000020;
pub const NI_NUMERICSCOPE: ::c_int = 0x00000040;
pub const RTLD_NOLOAD: ::c_int = 0x2000;
pub const RTLD_LOCAL: ::c_int = 0x200;
pub const CTL_MAXNAME: ::c_int = 12;
pub const SYSCTL_NAMELEN: ::c_int = 32;
pub const SYSCTL_DEFSIZE: ::c_int = 8;
pub const CTLTYPE_NODE: ::c_int = 1;
pub const CTLTYPE_INT: ::c_int = 2;
pub const CTLTYPE_STRING: ::c_int = 3;
pub const CTLTYPE_QUAD: ::c_int = 4;
pub const CTLTYPE_STRUCT: ::c_int = 5;
pub const CTLTYPE_BOOL: ::c_int = 6;
pub const CTLFLAG_READONLY: ::c_int = 0x00000000;
pub const CTLFLAG_READWRITE: ::c_int = 0x00000070;
pub const CTLFLAG_ANYWRITE: ::c_int = 0x00000080;
pub const CTLFLAG_PRIVATE: ::c_int = 0x00000100;
pub const CTLFLAG_PERMANENT: ::c_int = 0x00000200;
pub const CTLFLAG_OWNDATA: ::c_int = 0x00000400;
pub const CTLFLAG_IMMEDIATE: ::c_int = 0x00000800;
pub const CTLFLAG_HEX: ::c_int = 0x00001000;
pub const CTLFLAG_ROOT: ::c_int = 0x00002000;
pub const CTLFLAG_ANYNUMBER: ::c_int = 0x00004000;
pub const CTLFLAG_HIDDEN: ::c_int = 0x00008000;
pub const CTLFLAG_ALIAS: ::c_int = 0x00010000;
pub const CTLFLAG_MMAP: ::c_int = 0x00020000;
pub const CTLFLAG_OWNDESC: ::c_int = 0x00040000;
pub const CTLFLAG_UNSIGNED: ::c_int = 0x00080000;
pub const SYSCTL_VERS_MASK: ::c_int = 0xff000000;
pub const SYSCTL_VERS_0: ::c_int = 0x00000000;
pub const SYSCTL_VERS_1: ::c_int = 0x01000000;
pub const SYSCTL_VERSION: ::c_int = SYSCTL_VERS_1;
pub const CTL_EOL: ::c_int = -1;
pub const CTL_QUERY: ::c_int = -2;
pub const CTL_CREATE: ::c_int = -3;
pub const CTL_CREATESYM: ::c_int = -4;
pub const CTL_DESTROY: ::c_int = -5;
pub const CTL_MMAP: ::c_int = -6;
pub const CTL_DESCRIBE: ::c_int = -7;
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
pub const CTL_NET: ::c_int = 4;
pub const CTL_DEBUG: ::c_int = 5;
pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_DDB: ::c_int = 9;
pub const CTL_PROC: ::c_int = 10;
pub const CTL_VENDOR: ::c_int = 11;
pub const CTL_EMUL: ::c_int = 12;
pub const CTL_SECURITY: ::c_int = 13;
pub const CTL_MAXID: ::c_int = 14;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
pub const KERN_VERSION: ::c_int = 4;
pub const KERN_MAXVNODES: ::c_int = 5;
pub const KERN_MAXPROC: ::c_int = 6;
pub const KERN_MAXFILES: ::c_int = 7;
pub const KERN_ARGMAX: ::c_int = 8;
pub const KERN_SECURELVL: ::c_int = 9;
pub const KERN_HOSTNAME: ::c_int = 10;
pub const KERN_HOSTID: ::c_int = 11;
pub const KERN_CLOCKRATE: ::c_int = 12;
pub const KERN_VNODE: ::c_int = 13;
pub const KERN_PROC: ::c_int = 14;
pub const KERN_FILE: ::c_int = 15;
pub const KERN_PROF: ::c_int = 16;
pub const KERN_POSIX1: ::c_int = 17;
pub const KERN_NGROUPS: ::c_int = 18;
pub const KERN_JOB_CONTROL: ::c_int = 19;
pub const KERN_SAVED_IDS: ::c_int = 20;
pub const KERN_OBOOTTIME: ::c_int = 21;
pub const KERN_DOMAINNAME: ::c_int = 22;
pub const KERN_MAXPARTITIONS: ::c_int = 23;
pub const KERN_RAWPARTITION: ::c_int = 24;
pub const KERN_NTPTIME: ::c_int = 25;
pub const KERN_TIMEX: ::c_int = 26;
pub const KERN_AUTONICETIME: ::c_int = 27;
pub const KERN_AUTONICEVAL: ::c_int = 28;
pub const KERN_RTC_OFFSET: ::c_int = 29;
pub const KERN_ROOT_DEVICE: ::c_int = 30;
pub const KERN_MSGBUFSIZE: ::c_int = 31;
pub const KERN_FSYNC: ::c_int = 32;
pub const KERN_OLDSYSVMSG: ::c_int = 33;
pub const KERN_OLDSYSVSEM: ::c_int = 34;
pub const KERN_OLDSYSVSHM: ::c_int = 35;
pub const KERN_OLDSHORTCORENAME: ::c_int = 36;
pub const KERN_SYNCHRONIZED_IO: ::c_int = 37;
pub const KERN_IOV_MAX: ::c_int = 38;
pub const KERN_MBUF: ::c_int = 39;
pub const KERN_MAPPED_FILES: ::c_int = 40;
pub const KERN_MEMLOCK: ::c_int = 41;
pub const KERN_MEMLOCK_RANGE: ::c_int = 42;
pub const KERN_MEMORY_PROTECTION: ::c_int = 43;
pub const KERN_LOGIN_NAME_MAX: ::c_int = 44;
pub const KERN_DEFCORENAME: ::c_int = 45;
pub const KERN_LOGSIGEXIT: ::c_int = 46;
pub const KERN_PROC2: ::c_int = 47;
pub const KERN_PROC_ARGS: ::c_int = 48;
pub const KERN_FSCALE: ::c_int = 49;
pub const KERN_CCPU: ::c_int = 50;
pub const KERN_CP_TIME: ::c_int = 51;
pub const KERN_OLDSYSVIPC_INFO: ::c_int = 52;
pub const KERN_MSGBUF: ::c_int = 53;
pub const KERN_CONSDEV: ::c_int = 54;
pub const KERN_MAXPTYS: ::c_int = 55;
pub const KERN_PIPE: ::c_int = 56;
pub const KERN_MAXPHYS: ::c_int = 57;
pub const KERN_SBMAX: ::c_int = 58;
pub const KERN_TKSTAT: ::c_int = 59;
pub const KERN_MONOTONIC_CLOCK: ::c_int = 60;
pub const KERN_URND: ::c_int = 61;
pub const KERN_LABELSECTOR: ::c_int = 62;
pub const KERN_LABELOFFSET: ::c_int = 63;
pub const KERN_LWP: ::c_int = 64;
pub const KERN_FORKFSLEEP: ::c_int = 65;
pub const KERN_POSIX_THREADS: ::c_int = 66;
pub const KERN_POSIX_SEMAPHORES: ::c_int = 67;
pub const KERN_POSIX_BARRIERS: ::c_int = 68;
pub const KERN_POSIX_TIMERS: ::c_int = 69;
pub const KERN_POSIX_SPIN_LOCKS: ::c_int = 70;
pub const KERN_POSIX_READER_WRITER_LOCKS: ::c_int = 71;
pub const KERN_DUMP_ON_PANIC: ::c_int = 72;
pub const KERN_SOMAXKVA: ::c_int = 73;
pub const KERN_ROOT_PARTITION: ::c_int = 74;
pub const KERN_DRIVERS: ::c_int = 75;
pub const KERN_BUF: ::c_int = 76;
pub const KERN_FILE2: ::c_int = 77;
pub const KERN_VERIEXEC: ::c_int = 78;
pub const KERN_CP_ID: ::c_int = 79;
pub const KERN_HARDCLOCK_TICKS: ::c_int = 80;
pub const KERN_ARND: ::c_int = 81;
pub const KERN_SYSVIPC: ::c_int = 82;
pub const KERN_BOOTTIME: ::c_int = 83;
pub const KERN_EVCNT: ::c_int = 84;
pub const KERN_MAXID: ::c_int = 85;
pub const KERN_PROC_ALL: ::c_int = 0;
pub const KERN_PROC_PID: ::c_int = 1;
pub const KERN_PROC_PGRP: ::c_int = 2;
pub const KERN_PROC_SESSION: ::c_int = 3;
pub const KERN_PROC_TTY: ::c_int = 4;
pub const KERN_PROC_UID: ::c_int = 5;
pub const KERN_PROC_RUID: ::c_int = 6;
pub const KERN_PROC_GID: ::c_int = 7;
pub const KERN_PROC_RGID: ::c_int = 8;
pub const KERN_PROC_ARGV: ::c_int = 1;
pub const KERN_PROC_NARGV: ::c_int = 2;
pub const KERN_PROC_ENV: ::c_int = 3;
pub const KERN_PROC_NENV: ::c_int = 4;
pub const KERN_PROC_PATHNAME: ::c_int = 5;
pub const VM_PROC: ::c_int = 16;
pub const VM_PROC_MAP: ::c_int = 1;
pub const EAI_AGAIN: ::c_int = 2;
pub const EAI_BADFLAGS: ::c_int = 3;
pub const EAI_FAIL: ::c_int = 4;
pub const EAI_FAMILY: ::c_int = 5;
pub const EAI_MEMORY: ::c_int = 6;
pub const EAI_NODATA: ::c_int = 7;
pub const EAI_NONAME: ::c_int = 8;
pub const EAI_SERVICE: ::c_int = 9;
pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;
pub const EAI_OVERFLOW: ::c_int = 14;
pub const AIO_CANCELED: ::c_int = 1;
pub const AIO_NOTCANCELED: ::c_int = 2;
pub const AIO_ALLDONE: ::c_int = 3;
pub const LIO_NOP: ::c_int = 0;
pub const LIO_WRITE: ::c_int = 1;
pub const LIO_READ: ::c_int = 2;
pub const LIO_WAIT: ::c_int = 1;
pub const LIO_NOWAIT: ::c_int = 0;
pub const SIGEV_NONE: ::c_int = 0;
pub const SIGEV_SIGNAL: ::c_int = 1;
pub const SIGEV_THREAD: ::c_int = 2;
pub const WSTOPPED: ::c_int = 0x00000002; // same as WUNTRACED
pub const WCONTINUED: ::c_int = 0x00000010;
pub const WEXITED: ::c_int = 0x000000020;
pub const WNOWAIT: ::c_int = 0x00010000;
pub const WALTSIG: ::c_int = 0x00000004;
pub const WALLSIG: ::c_int = 0x00000008;
pub const WTRAPPED: ::c_int = 0x00000040;
pub const WNOZOMBIE: ::c_int = 0x00020000;
pub const P_ALL: idtype_t = 0;
pub const P_PID: idtype_t = 1;
pub const P_PGID: idtype_t = 4;
pub const UTIME_OMIT: c_long = 1073741822;
pub const UTIME_NOW: c_long = 1073741823;
pub const B460800: ::speed_t = 460800;
pub const B921600: ::speed_t = 921600;
pub const ONOCR: ::tcflag_t = 0x20;
pub const ONLRET: ::tcflag_t = 0x40;
pub const CDTRCTS: ::tcflag_t = 0x00020000;
pub const CHWFLOW: ::tcflag_t = ::MDMBUF | ::CRTSCTS | ::CDTRCTS;
// pub const _PATH_UTMPX: &[::c_char; 14] = b"/var/run/utmpx";
// pub const _PATH_WTMPX: &[::c_char; 14] = b"/var/log/wtmpx";
// pub const _PATH_LASTLOGX: &[::c_char; 17] = b"/var/log/lastlogx";
// pub const _PATH_UTMP_UPDATE: &[::c_char; 24] = b"/usr/libexec/utmp_update";
pub const UT_NAMESIZE: usize = 8;
pub const UT_LINESIZE: usize = 8;
pub const UT_HOSTSIZE: usize = 16;
pub const _UTX_USERSIZE: usize = 32;
pub const _UTX_LINESIZE: usize = 32;
pub const _UTX_PADSIZE: usize = 40;
pub const _UTX_IDSIZE: usize = 4;
pub const _UTX_HOSTSIZE: usize = 256;
pub const EMPTY: u16 = 0;
pub const RUN_LVL: u16 = 1;
pub const BOOT_TIME: u16 = 2;
pub const OLD_TIME: u16 = 3;
pub const NEW_TIME: u16 = 4;
pub const INIT_PROCESS: u16 = 5;
pub const LOGIN_PROCESS: u16 = 6;
pub const USER_PROCESS: u16 = 7;
pub const DEAD_PROCESS: u16 = 8;
pub const ACCOUNTING: u16 = 9;
pub const SIGNATURE: u16 = 10;
pub const DOWN_TIME: u16 = 11;
pub const SOCK_CLOEXEC: ::c_int = 0x10000000;
pub const SOCK_NONBLOCK: ::c_int = 0x20000000;
// Uncomment on next NetBSD release
// pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;
// pub const FIOSEEKHOLE: ::c_ulong = 0xc0086662;
pub const OFIOGETBMAP: ::c_ulong = 0xc004667a;
pub const FIOGETBMAP: ::c_ulong = 0xc008667a;
pub const FIONWRITE: ::c_ulong = 0x40046679;
pub const FIONSPACE: ::c_ulong = 0x40046678;
pub const FIBMAP: ::c_ulong = 0xc008667a;
pub const SIGSTKSZ: ::size_t = 40960;
pub const REG_ENOSYS: ::c_int = 17;
pub const PT_DUMPCORE: ::c_int = 12;
pub const PT_LWPINFO: ::c_int = 13;
pub const PT_SYSCALL: ::c_int = 14;
pub const PT_SYSCALLEMU: ::c_int = 15;
pub const PT_SET_EVENT_MASK: ::c_int = 16;
pub const PT_GET_EVENT_MASK: ::c_int = 17;
pub const PT_GET_PROCESS_STATE: ::c_int = 18;
pub const PT_SET_SIGINFO: ::c_int = 19;
pub const PT_GET_SIGINFO: ::c_int = 20;
pub const PT_RESUME: ::c_int = 21;
pub const PT_SUSPEND: ::c_int = 23;
pub const PT_STOP: ::c_int = 23;
pub const PT_LWPSTATUS: ::c_int = 24;
pub const PT_LWPNEXT: ::c_int = 25;
pub const PT_SET_SIGPASS: ::c_int = 26;
pub const PT_GET_SIGPASS: ::c_int = 27;
pub const PT_FIRSTMACH: ::c_int = 32;
pub const POSIX_SPAWN_RETURNERROR: ::c_int = 0x40;
// Flags for chflags(2)
pub const SF_APPEND: ::c_ulong = 0x00040000;
pub const SF_ARCHIVED: ::c_ulong = 0x00010000;
pub const SF_IMMUTABLE: ::c_ulong = 0x00020000;
pub const SF_LOG: ::c_ulong = 0x00400000;
pub const SF_SETTABLE: ::c_ulong = 0xffff0000;
pub const SF_SNAPINVAL: ::c_ulong = 0x00800000;
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
pub const UF_APPEND: ::c_ulong = 0x00000004;
pub const UF_IMMUTABLE: ::c_ulong = 0x00000002;
pub const UF_NODUMP: ::c_ulong = 0x00000001;
pub const UF_OPAQUE: ::c_ulong = 0x00000008;
pub const UF_SETTABLE: ::c_ulong = 0x0000ffff;
// sys/sysctl.h
pub const KVME_PROT_READ: ::c_int = 0x00000001;
pub const KVME_PROT_WRITE: ::c_int = 0x00000002;
pub const KVME_PROT_EXEC: ::c_int = 0x00000004;
pub const KVME_FLAG_COW: ::c_int = 0x00000001;
pub const KVME_FLAG_NEEDS_COPY: ::c_int = 0x00000002;
pub const KVME_FLAG_NOCOREDUMP: ::c_int = 0x000000004;
pub const KVME_FLAG_PAGEABLE: ::c_int = 0x000000008;
pub const KVME_FLAG_GROWS_UP: ::c_int = 0x000000010;
pub const KVME_FLAG_GROWS_DOWN: ::c_int = 0x000000020;
pub const NGROUPS_MAX: ::c_int = 16;
pub const KI_NGROUPS: ::c_int = 16;
pub const KI_MAXCOMLEN: ::c_int = 24;
pub const KI_WMESGLEN: ::c_int = 8;
pub const KI_MAXLOGNAME: ::c_int = 24;
pub const KI_MAXEMULLEN: ::c_int = 16;
pub const KI_LNAMELEN: ::c_int = 20;
// sys/lwp.h
pub const LSIDL: ::c_int = 1;
pub const LSRUN: ::c_int = 2;
pub const LSSLEEP: ::c_int = 3;
pub const LSSTOP: ::c_int = 4;
pub const LSZOMB: ::c_int = 5;
pub const LSONPROC: ::c_int = 7;
pub const LSSUSPENDED: ::c_int = 8;
// sys/xattr.h
pub const XATTR_CREATE: ::c_int = 0x01;
pub const XATTR_REPLACE: ::c_int = 0x02;
// sys/extattr.h
pub const EXTATTR_NAMESPACE_EMPTY: ::c_int = 0;
// For getrandom()
pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;
// sys/reboot.h
pub const RB_ASKNAME: ::c_int = 0x000000001;
pub const RB_SINGLE: ::c_int = 0x000000002;
pub const RB_NOSYNC: ::c_int = 0x000000004;
pub const RB_HALT: ::c_int = 0x000000008;
pub const RB_INITNAME: ::c_int = 0x000000010;
pub const RB_KDB: ::c_int = 0x000000040;
pub const RB_RDONLY: ::c_int = 0x000000080;
pub const RB_DUMP: ::c_int = 0x000000100;
pub const RB_MINIROOT: ::c_int = 0x000000200;
pub const RB_STRING: ::c_int = 0x000000400;
pub const RB_POWERDOWN: ::c_int = RB_HALT | 0x000000800;
pub const RB_USERCONF: ::c_int = 0x000001000;
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
pub const fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
alignment << MAP_ALIGNMENT_SHIFT
}
} else {
pub fn MAP_ALIGNED(alignment: ::c_int) -> ::c_int {
alignment << MAP_ALIGNMENT_SHIFT
}
}
}
const_fn! {
{const} fn _ALIGN(p: usize) -> usize {
(p + _ALIGNBYTES) & !_ALIGNBYTES
}
}
f! {
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
pub {const} fn CMSG_LEN(length: ::c_uint) -> ::c_uint {
_ALIGN(::mem::size_of::<::cmsghdr>()) as ::c_uint + length
}
pub fn CMSG_NXTHDR(mhdr: *const ::msghdr, cmsg: *const ::cmsghdr)
-> *mut ::cmsghdr
{
if cmsg.is_null() {
return ::CMSG_FIRSTHDR(mhdr);
};
let next = cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)
+ _ALIGN(::mem::size_of::<::cmsghdr>());
let max = (*mhdr).msg_control as usize
+ (*mhdr).msg_controllen as usize;
if next > max {
0 as *mut ::cmsghdr
} else {
(cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize))
as *mut ::cmsghdr
}
}
pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
(_ALIGN(::mem::size_of::<::cmsghdr>()) + _ALIGN(length as usize))
as ::c_uint
}
// dirfd() is a macro on netbsd to access
// the first field of the struct where dirp points to:
// http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int {
*(dirp as *const ::c_int)
}
pub fn SOCKCREDSIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
ngrps - 1
} else {
0
};
::mem::size_of::() + ::mem::size_of::<::gid_t>() * ngrps
}
pub fn PROT_MPROTECT(x: ::c_int) -> ::c_int {
x << 3
}
pub fn PROT_MPROTECT_EXTRACT(x: ::c_int) -> ::c_int {
(x >> 3) & 0x7
}
pub fn major(dev: ::dev_t) -> ::c_int {
(((dev as u32) & 0x000fff00) >> 8) as ::c_int
}
pub fn minor(dev: ::dev_t) -> ::c_int {
let mut res = 0;
res |= ((dev as u32) & 0xfff00000) >> 12;
res |= (dev as u32) & 0x000000ff;
res as ::c_int
}
}
safe_f! {
pub {const} fn WSTOPSIG(status: ::c_int) -> ::c_int {
status >> 8
}
pub {const} fn WIFSIGNALED(status: ::c_int) -> bool {
(status & 0o177) != 0o177 && (status & 0o177) != 0
}
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0o177) == 0o177
}
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0xffff
}
pub {const} fn makedev(major: ::c_uint, minor: ::c_uint) -> ::dev_t {
let major = major as ::dev_t;
let minor = minor as ::dev_t;
let mut dev = 0;
dev |= (major << 8) & 0x000ff00;
dev |= (minor << 12) & 0xfff00000;
dev |= minor & 0xff;
dev
}
}
extern "C" {
pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
pub fn clock_nanosleep(
clk_id: ::clockid_t,
flags: ::c_int,
rqtp: *const ::timespec,
rmtp: *mut ::timespec,
) -> ::c_int;
pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn extattr_list_fd(
fd: ::c_int,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_list_file(
path: *const ::c_char,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_list_link(
path: *const ::c_char,
attrnamespace: ::c_int,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_delete_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_delete_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_delete_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
) -> ::c_int;
pub fn extattr_get_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_get_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_get_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *mut ::c_void,
nbytes: ::size_t,
) -> ::ssize_t;
pub fn extattr_namespace_to_string(
attrnamespace: ::c_int,
string: *mut *mut ::c_char,
) -> ::c_int;
pub fn extattr_set_fd(
fd: ::c_int,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::c_int;
pub fn extattr_set_file(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::c_int;
pub fn extattr_set_link(
path: *const ::c_char,
attrnamespace: ::c_int,
attrname: *const ::c_char,
data: *const ::c_void,
nbytes: ::size_t,
) -> ::c_int;
pub fn extattr_string_to_namespace(
string: *const ::c_char,
attrnamespace: *mut ::c_int,
) -> ::c_int;
pub fn openpty(
amaster: *mut ::c_int,
aslave: *mut ::c_int,
name: *mut ::c_char,
termp: *mut ::termios,
winp: *mut ::winsize,
) -> ::c_int;
pub fn forkpty(
amaster: *mut ::c_int,
name: *mut ::c_char,
termp: *mut ::termios,
winp: *mut ::winsize,
) -> ::pid_t;
#[link_name = "__lutimes50"]
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
#[link_name = "__gettimeofday50"]
pub fn gettimeofday(tp: *mut ::timeval, tz: *mut ::c_void) -> ::c_int;
pub fn getnameinfo(
sa: *const ::sockaddr,
salen: ::socklen_t,
host: *mut ::c_char,
hostlen: ::socklen_t,
serv: *mut ::c_char,
servlen: ::socklen_t,
flags: ::c_int,
) -> ::c_int;
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
pub fn sysctl(
name: *const ::c_int,
namelen: ::c_uint,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *const ::c_void,
newlen: ::size_t,
) -> ::c_int;
pub fn sysctlbyname(
name: *const ::c_char,
oldp: *mut ::c_void,
oldlenp: *mut ::size_t,
newp: *const ::c_void,
newlen: ::size_t,
) -> ::c_int;
#[link_name = "__kevent50"]
pub fn kevent(
kq: ::c_int,
changelist: *const ::kevent,
nchanges: ::size_t,
eventlist: *mut ::kevent,
nevents: ::size_t,
timeout: *const ::timespec,
) -> ::c_int;
#[link_name = "__mount50"]
pub fn mount(
src: *const ::c_char,
target: *const ::c_char,
flags: ::c_int,
data: *mut ::c_void,
size: ::size_t,
) -> ::c_int;
pub fn mq_open(name: *const ::c_char, oflag: ::c_int, ...) -> ::mqd_t;
pub fn mq_close(mqd: ::mqd_t) -> ::c_int;
pub fn mq_getattr(mqd: ::mqd_t, attr: *mut ::mq_attr) -> ::c_int;
pub fn mq_notify(mqd: ::mqd_t, notification: *const ::sigevent) -> ::c_int;
pub fn mq_receive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
) -> ::ssize_t;
pub fn mq_send(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
) -> ::c_int;
pub fn mq_setattr(mqd: ::mqd_t, newattr: *const ::mq_attr, oldattr: *mut ::mq_attr) -> ::c_int;
#[link_name = "__mq_timedreceive50"]
pub fn mq_timedreceive(
mqd: ::mqd_t,
msg_ptr: *mut ::c_char,
msg_len: ::size_t,
msg_prio: *mut ::c_uint,
abs_timeout: *const ::timespec,
) -> ::ssize_t;
#[link_name = "__mq_timedsend50"]
pub fn mq_timedsend(
mqd: ::mqd_t,
msg_ptr: *const ::c_char,
msg_len: ::size_t,
msg_prio: ::c_uint,
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
pub fn ptrace(request: ::c_int, pid: ::pid_t, addr: *mut ::c_void, data: ::c_int) -> ::c_int;
pub fn utrace(label: *const ::c_char, addr: *mut ::c_void, len: ::size_t) -> ::c_int;
pub fn pthread_getname_np(t: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_setname_np(
t: ::pthread_t,
name: *const ::c_char,
arg: *const ::c_void,
) -> ::c_int;
pub fn pthread_attr_get_np(thread: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_getattr_np(native: ::pthread_t, attr: *mut ::pthread_attr_t) -> ::c_int;
pub fn pthread_attr_getguardsize(
attr: *const ::pthread_attr_t,
guardsize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_attr_setguardsize(attr: *mut ::pthread_attr_t, guardsize: ::size_t) -> ::c_int;
pub fn pthread_attr_getstack(
attr: *const ::pthread_attr_t,
stackaddr: *mut *mut ::c_void,
stacksize: *mut ::size_t,
) -> ::c_int;
pub fn pthread_getaffinity_np(
thread: ::pthread_t,
size: ::size_t,
set: *mut cpuset_t,
) -> ::c_int;
pub fn pthread_setaffinity_np(
thread: ::pthread_t,
size: ::size_t,
set: *mut cpuset_t,
) -> ::c_int;
pub fn _cpuset_create() -> *mut cpuset_t;
pub fn _cpuset_destroy(set: *mut cpuset_t);
pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> ::c_int;
pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> ::c_int;
pub fn _cpuset_size(set: *const cpuset_t) -> ::size_t;
pub fn _cpuset_zero(set: *mut cpuset_t);
#[link_name = "__sigtimedwait50"]
pub fn sigtimedwait(
set: *const sigset_t,
info: *mut siginfo_t,
timeout: *const ::timespec,
) -> ::c_int;
pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> ::c_int;
pub fn duplocale(base: ::locale_t) -> ::locale_t;
pub fn freelocale(loc: ::locale_t);
pub fn localeconv_l(loc: ::locale_t) -> *mut lconv;
pub fn newlocale(mask: ::c_int, locale: *const ::c_char, base: ::locale_t) -> ::locale_t;
#[link_name = "__settimeofday50"]
pub fn settimeofday(tv: *const ::timeval, tz: *const ::c_void) -> ::c_int;
pub fn dup3(src: ::c_int, dst: ::c_int, flags: ::c_int) -> ::c_int;
pub fn kqueue1(flags: ::c_int) -> ::c_int;
pub fn sendmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
) -> ::c_int;
pub fn recvmmsg(
sockfd: ::c_int,
msgvec: *mut ::mmsghdr,
vlen: ::c_uint,
flags: ::c_int,
timeout: *mut ::timespec,
) -> ::c_int;
pub fn _lwp_self() -> lwpid_t;
pub fn memmem(
haystack: *const ::c_void,
haystacklen: ::size_t,
needle: *const ::c_void,
needlelen: ::size_t,
) -> *mut ::c_void;
// link.h
pub fn dl_iterate_phdr(
callback: ::Option<
unsafe extern "C" fn(
info: *mut dl_phdr_info,
size: usize,
data: *mut ::c_void,
) -> ::c_int,
>,
data: *mut ::c_void,
) -> ::c_int;
// dlfcn.h
pub fn _dlauxinfo() -> *mut ::c_void;
pub fn iconv_open(tocode: *const ::c_char, fromcode: *const ::c_char) -> iconv_t;
pub fn iconv(
cd: iconv_t,
inbuf: *mut *mut ::c_char,
inbytesleft: *mut ::size_t,
outbuf: *mut *mut ::c_char,
outbytesleft: *mut ::size_t,
) -> ::size_t;
pub fn iconv_close(cd: iconv_t) -> ::c_int;
pub fn timer_create(
clockid: ::clockid_t,
sevp: *mut ::sigevent,
timerid: *mut ::timer_t,
) -> ::c_int;
pub fn timer_delete(timerid: ::timer_t) -> ::c_int;
pub fn timer_getoverrun(timerid: ::timer_t) -> ::c_int;
pub fn timer_gettime(timerid: ::timer_t, curr_value: *mut ::itimerspec) -> ::c_int;
pub fn timer_settime(
timerid: ::timer_t,
flags: ::c_int,
new_value: *const ::itimerspec,
old_value: *mut ::itimerspec,
) -> ::c_int;
// Added in `NetBSD` 7.0
pub fn explicit_memset(b: *mut ::c_void, c: ::c_int, len: ::size_t);
pub fn consttime_memequal(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn setproctitle(fmt: *const ::c_char, ...);
pub fn mremap(
oldp: *mut ::c_void,
oldsize: ::size_t,
newp: *mut ::c_void,
newsize: ::size_t,
flags: ::c_int,
) -> *mut ::c_void;
pub fn sched_rr_get_interval(pid: ::pid_t, t: *mut ::timespec) -> ::c_int;
pub fn sched_setparam(pid: ::pid_t, param: *const ::sched_param) -> ::c_int;
pub fn sched_getparam(pid: ::pid_t, param: *mut ::sched_param) -> ::c_int;
pub fn sched_getscheduler(pid: ::pid_t) -> ::c_int;
pub fn sched_setscheduler(
pid: ::pid_t,
policy: ::c_int,
param: *const ::sched_param,
) -> ::c_int;
#[link_name = "__pollts50"]
pub fn pollts(
fds: *mut ::pollfd,
nfds: ::nfds_t,
ts: *const ::timespec,
sigmask: *const ::sigset_t,
) -> ::c_int;
pub fn ppoll(
fds: *mut ::pollfd,
nfds: ::nfds_t,
ts: *const ::timespec,
sigmask: *const ::sigset_t,
) -> ::c_int;
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn reboot(mode: ::c_int, bootstr: *mut ::c_char) -> ::c_int;
}
#[link(name = "rt")]
extern "C" {
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
#[link_name = "__aio_suspend50"]
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
}
#[link(name = "util")]
extern "C" {
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
pub fn getpwent_r(
pwd: *mut ::passwd,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::passwd,
) -> ::c_int;
pub fn getgrent_r(
grp: *mut ::group,
buf: *mut ::c_char,
buflen: ::size_t,
result: *mut *mut ::group,
) -> ::c_int;
pub fn updwtmpx(file: *const ::c_char, ut: *const utmpx) -> ::c_int;
pub fn getlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> *mut lastlogx;
pub fn updlastlogx(fname: *const ::c_char, uid: ::uid_t, ll: *mut lastlogx) -> ::c_int;
pub fn utmpxname(file: *const ::c_char) -> ::c_int;
pub fn getutxent() -> *mut utmpx;
pub fn getutxid(ut: *const utmpx) -> *mut utmpx;
pub fn getutxline(ut: *const utmpx) -> *mut utmpx;
pub fn pututxline(ut: *const utmpx) -> *mut utmpx;
pub fn setutxent();
pub fn endutxent();
pub fn getutmp(ux: *const utmpx, u: *mut utmp);
pub fn getutmpx(u: *const utmp, ux: *mut utmpx);
pub fn utpname(file: *const ::c_char) -> ::c_int;
pub fn setutent();
pub fn endutent();
pub fn getutent() -> *mut utmp;
pub fn efopen(p: *const ::c_char, m: *const ::c_char) -> ::FILE;
pub fn emalloc(n: ::size_t) -> *mut ::c_void;
pub fn ecalloc(n: ::size_t, c: ::size_t) -> *mut ::c_void;
pub fn erealloc(p: *mut ::c_void, n: ::size_t) -> *mut ::c_void;
pub fn ereallocarr(p: *mut ::c_void, n: ::size_t, s: ::size_t);
pub fn estrdup(s: *const ::c_char) -> *mut ::c_char;
pub fn estrndup(s: *const ::c_char, len: ::size_t) -> *mut ::c_char;
pub fn estrlcpy(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
pub fn estrlcat(dst: *mut ::c_char, src: *const ::c_char, len: ::size_t) -> ::size_t;
pub fn estrtoi(
nptr: *const ::c_char,
base: ::c_int,
lo: ::intmax_t,
hi: ::intmax_t,
) -> ::intmax_t;
pub fn estrtou(
nptr: *const ::c_char,
base: ::c_int,
lo: ::uintmax_t,
hi: ::uintmax_t,
) -> ::uintmax_t;
pub fn easprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
pub fn evasprintf(string: *mut *mut ::c_char, fmt: *const ::c_char, ...) -> ::c_int;
pub fn esetfunc(
cb: ::Option,
) -> ::Option;
pub fn secure_path(path: *const ::c_char) -> ::c_int;
pub fn snprintb(
buf: *mut ::c_char,
buflen: ::size_t,
fmt: *const ::c_char,
val: u64,
) -> ::c_int;
pub fn snprintb_m(
buf: *mut ::c_char,
buflen: ::size_t,
fmt: *const ::c_char,
val: u64,
max: ::size_t,
) -> ::c_int;
pub fn getbootfile() -> *const ::c_char;
pub fn getbyteorder() -> ::c_int;
pub fn getdiskrawname(
buf: *mut ::c_char,
buflen: ::size_t,
name: *const ::c_char,
) -> *const ::c_char;
pub fn getdiskcookedname(
buf: *mut ::c_char,
buflen: ::size_t,
name: *const ::c_char,
) -> *const ::c_char;
pub fn getfsspecname(
buf: *mut ::c_char,
buflen: ::size_t,
spec: *const ::c_char,
) -> *const ::c_char;
pub fn strpct(
buf: *mut ::c_char,
bufsiz: ::size_t,
numerator: ::uintmax_t,
denominator: ::uintmax_t,
precision: ::size_t,
) -> *mut ::c_char;
pub fn strspct(
buf: *mut ::c_char,
bufsiz: ::size_t,
numerator: ::intmax_t,
denominator: ::intmax_t,
precision: ::size_t,
) -> *mut ::c_char;
#[link_name = "__login50"]
pub fn login(ut: *const utmp);
#[link_name = "__loginx50"]
pub fn loginx(ut: *const utmpx);
pub fn logout(line: *const ::c_char);
pub fn logoutx(line: *const ::c_char, status: ::c_int, tpe: ::c_int);
pub fn logwtmp(line: *const ::c_char, name: *const ::c_char, host: *const ::c_char);
pub fn logwtmpx(
line: *const ::c_char,
name: *const ::c_char,
host: *const ::c_char,
status: ::c_int,
tpe: ::c_int,
);
pub fn getxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *mut ::c_void,
size: ::size_t,
) -> ::ssize_t;
pub fn lgetxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *mut ::c_void,
size: ::size_t,
) -> ::ssize_t;
pub fn fgetxattr(
filedes: ::c_int,
name: *const ::c_char,
value: *mut ::c_void,
size: ::size_t,
) -> ::ssize_t;
pub fn setxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *const ::c_void,
size: ::size_t,
) -> ::c_int;
pub fn lsetxattr(
path: *const ::c_char,
name: *const ::c_char,
value: *const ::c_void,
size: ::size_t,
) -> ::c_int;
pub fn fsetxattr(
filedes: ::c_int,
name: *const ::c_char,
value: *const ::c_void,
size: ::size_t,
flags: ::c_int,
) -> ::c_int;
pub fn listxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
pub fn llistxattr(path: *const ::c_char, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
pub fn flistxattr(filedes: ::c_int, list: *mut ::c_char, size: ::size_t) -> ::ssize_t;
pub fn removexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
pub fn lremovexattr(path: *const ::c_char, name: *const ::c_char) -> ::c_int;
pub fn fremovexattr(fd: ::c_int, path: *const ::c_char, name: *const ::c_char) -> ::c_int;
pub fn string_to_flags(
string_p: *mut *mut ::c_char,
setp: *mut ::c_ulong,
clrp: *mut ::c_ulong,
) -> ::c_int;
pub fn flags_to_string(flags: ::c_ulong, def: *const ::c_char) -> ::c_int;
pub fn kinfo_getvmmap(pid: ::pid_t, cntp: *mut ::size_t) -> *mut kinfo_vmentry;
}
#[link(name = "execinfo")]
extern "C" {
pub fn backtrace(addrlist: *mut *mut ::c_void, len: ::size_t) -> ::size_t;
pub fn backtrace_symbols(addrlist: *const *mut ::c_void, len: ::size_t) -> *mut *mut ::c_char;
pub fn backtrace_symbols_fd(
addrlist: *const *mut ::c_void,
len: ::size_t,
fd: ::c_int,
) -> ::c_int;
pub fn backtrace_symbols_fmt(
addrlist: *const *mut ::c_void,
len: ::size_t,
fmt: *const ::c_char,
) -> *mut *mut ::c_char;
pub fn backtrace_symbols_fd_fmt(
addrlist: *const *mut ::c_void,
len: ::size_t,
fd: ::c_int,
fmt: *const ::c_char,
) -> ::c_int;
}
cfg_if! {
if #[cfg(libc_union)] {
extern {
// these functions use statvfs:
pub fn getmntinfo(mntbufp: *mut *mut ::statvfs, flags: ::c_int) -> ::c_int;
pub fn getvfsstat(buf: *mut statvfs, bufsize: ::size_t, flags: ::c_int) -> ::c_int;
}
}
}
cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub use self::aarch64::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub use self::arm::*;
} else if #[cfg(target_arch = "powerpc")] {
mod powerpc;
pub use self::powerpc::*;
} else if #[cfg(target_arch = "sparc64")] {
mod sparc64;
pub use self::sparc64::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub use self::x86_64::*;
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub use self::x86::*;
} else if #[cfg(target_arch = "mips")] {
mod mips;
pub use self::mips::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub use self::riscv64::*;
} else {
// Unknown target_arch
}
}
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/powerpc.rs 0000644 0000000 0000000 00000001071 10461020230 0020655 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/riscv64.rs 0000644 0000000 0000000 00000001071 10461020230 0020476 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type __cpu_simple_lock_nv_t = ::c_int;
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 0;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 3;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/sparc64.rs 0000644 0000000 0000000 00000000335 10461020230 0020462 0 ustar 0000000 0000000 pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
// should be pub(crate), but that requires Rust 1.18.0
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 0xf;
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/x86.rs 0000644 0000000 0000000 00000000621 10461020230 0017623 0 ustar 0000000 0000000 pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = i8;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 4 - 1;
}
}
libc-0.2.152/src/unix/bsd/netbsdlike/netbsd/x86_64.rs 0000644 0000000 0000000 00000003635 10461020230 0020144 0 ustar 0000000 0000000 use PT_FIRSTMACH;
pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
pub type c___greg_t = u64;
pub type __cpu_simple_lock_nv_t = ::c_uchar;
s! {
pub struct mcontext_t {
pub __gregs: [c___greg_t; 26],
pub _mc_tlsbase: c___greg_t,
pub __fpregs: [[::c_char;32]; 16],
}
pub struct ucontext_t {
pub uc_flags: ::c_uint,
pub uc_link: *mut ::ucontext_t,
pub uc_sigmask: ::sigset_t,
pub uc_stack: ::stack_t,
pub uc_mcontext: ::mcontext_t,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const PT_STEP: ::c_int = PT_FIRSTMACH + 0;
pub const PT_GETREGS: ::c_int = PT_FIRSTMACH + 1;
pub const PT_SETREGS: ::c_int = PT_FIRSTMACH + 2;
pub const PT_GETFPREGS: ::c_int = PT_FIRSTMACH + 3;
pub const PT_SETFPREGS: ::c_int = PT_FIRSTMACH + 4;
pub const _REG_RDI: ::c_int = 0;
pub const _REG_RSI: ::c_int = 1;
pub const _REG_RDX: ::c_int = 2;
pub const _REG_RCX: ::c_int = 3;
pub const _REG_R8: ::c_int = 4;
pub const _REG_R9: ::c_int = 5;
pub const _REG_R10: ::c_int = 6;
pub const _REG_R11: ::c_int = 7;
pub const _REG_R12: ::c_int = 8;
pub const _REG_R13: ::c_int = 9;
pub const _REG_R14: ::c_int = 10;
pub const _REG_R15: ::c_int = 11;
pub const _REG_RBP: ::c_int = 12;
pub const _REG_RBX: ::c_int = 13;
pub const _REG_RAX: ::c_int = 14;
pub const _REG_GS: ::c_int = 15;
pub const _REG_FS: ::c_int = 16;
pub const _REG_ES: ::c_int = 17;
pub const _REG_DS: ::c_int = 18;
pub const _REG_TRAPNO: ::c_int = 19;
pub const _REG_ERR: ::c_int = 20;
pub const _REG_RIP: ::c_int = 21;
pub const _REG_CS: ::c_int = 22;
pub const _REG_RFLAGS: ::c_int = 23;
pub const _REG_RSP: ::c_int = 24;
pub const _REG_SS: ::c_int = 25;
libc-0.2.152/src/unix/bsd/netbsdlike/openbsd/aarch64.rs 0000644 0000000 0000000 00000001322 10461020230 0020600 0 ustar 0000000 0000000 pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = u8;
pub type ucontext_t = sigcontext;
s! {
pub struct sigcontext {
__sc_unused: ::c_int,
pub sc_mask: ::c_int,
pub sc_sp: ::c_ulong,
pub sc_lr: ::c_ulong,
pub sc_elr: ::c_ulong,
pub sc_spsr: ::c_ulong,
pub sc_x: [::c_ulong; 30],
pub sc_cookie: ::c_long,
}
}
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;
libc-0.2.152/src/unix/bsd/netbsdlike/openbsd/arm.rs 0000644 0000000 0000000 00000000615 10461020230 0020133 0 ustar 0000000 0000000 pub type c_long = i32;
pub type c_ulong = u32;
pub type c_char = u8;
// should be pub(crate), but that requires Rust 1.18.0
cfg_if! {
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_double>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
}
pub const _MAX_PAGE_SHIFT: u32 = 12;
libc-0.2.152/src/unix/bsd/netbsdlike/openbsd/mips64.rs 0000644 0000000 0000000 00000000235 10461020230 0020474 0 ustar 0000000 0000000 pub type c_long = i64;
pub type c_ulong = u64;
pub type c_char = i8;
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 7;
pub const _MAX_PAGE_SHIFT: u32 = 14;
libc-0.2.152/src/unix/bsd/netbsdlike/openbsd/mod.rs 0000644 0000000 0000000 00000222773 10461020230 0020146 0 ustar 0000000 0000000 use unix::bsd::O_SYNC;
pub type clock_t = i64;
pub type suseconds_t = ::c_long;
pub type dev_t = i32;
pub type sigset_t = ::c_uint;
pub type blksize_t = i32;
pub type fsblkcnt_t = u64;
pub type fsfilcnt_t = u64;
pub type idtype_t = ::c_uint;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_mutex_t = *mut ::c_void;
pub type pthread_mutexattr_t = *mut ::c_void;
pub type pthread_cond_t = *mut ::c_void;
pub type pthread_condattr_t = *mut ::c_void;
pub type pthread_rwlock_t = *mut ::c_void;
pub type pthread_rwlockattr_t = *mut ::c_void;
pub type pthread_spinlock_t = ::uintptr_t;
pub type caddr_t = *mut ::c_char;
// elf.h
pub type Elf32_Addr = u32;
pub type Elf32_Half = u16;
pub type Elf32_Lword = u64;
pub type Elf32_Off = u32;
pub type Elf32_Sword = i32;
pub type Elf32_Word = u32;
pub type Elf64_Addr = u64;
pub type Elf64_Half = u16;
pub type Elf64_Lword = u64;
pub type Elf64_Off = u64;
pub type Elf64_Sword = i32;
pub type Elf64_Sxword = i64;
pub type Elf64_Word = u32;
pub type Elf64_Xword = u64;
// search.h
pub type ENTRY = entry;
pub type ACTION = ::c_uint;
// spawn.h
pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;
cfg_if! {
if #[cfg(target_pointer_width = "64")] {
type Elf_Addr = Elf64_Addr;
type Elf_Half = Elf64_Half;
type Elf_Phdr = Elf64_Phdr;
} else if #[cfg(target_pointer_width = "32")] {
type Elf_Addr = Elf32_Addr;
type Elf_Half = Elf32_Half;
type Elf_Phdr = Elf32_Phdr;
}
}
s! {
pub struct ip_mreqn {
pub imr_multiaddr: in_addr,
pub imr_address: in_addr,
pub imr_ifindex: ::c_int,
}
pub struct glob_t {
pub gl_pathc: ::size_t,
pub gl_matchc: ::size_t,
pub gl_offs: ::size_t,
pub gl_flags: ::c_int,
pub gl_pathv: *mut *mut ::c_char,
__unused1: *mut ::c_void,
__unused2: *mut ::c_void,
__unused3: *mut ::c_void,
__unused4: *mut ::c_void,
__unused5: *mut ::c_void,
__unused6: *mut ::c_void,
__unused7: *mut ::c_void,
}
pub struct lconv {
pub decimal_point: *mut ::c_char,
pub thousands_sep: *mut ::c_char,
pub grouping: *mut ::c_char,
pub int_curr_symbol: *mut ::c_char,
pub currency_symbol: *mut ::c_char,
pub mon_decimal_point: *mut ::c_char,
pub mon_thousands_sep: *mut ::c_char,
pub mon_grouping: *mut ::c_char,
pub positive_sign: *mut ::c_char,
pub negative_sign: *mut ::c_char,
pub int_frac_digits: ::c_char,
pub frac_digits: ::c_char,
pub p_cs_precedes: ::c_char,
pub p_sep_by_space: ::c_char,
pub n_cs_precedes: ::c_char,
pub n_sep_by_space: ::c_char,
pub p_sign_posn: ::c_char,
pub n_sign_posn: ::c_char,
pub int_p_cs_precedes: ::c_char,
pub int_p_sep_by_space: ::c_char,
pub int_n_cs_precedes: ::c_char,
pub int_n_sep_by_space: ::c_char,
pub int_p_sign_posn: ::c_char,
pub int_n_sign_posn: ::c_char,
}
pub struct ufs_args {
pub fspec: *mut ::c_char,
pub export_info: export_args,
}
pub struct mfs_args {
pub fspec: *mut ::c_char,
pub export_info: export_args,
// https://github.com/openbsd/src/blob/HEAD/sys/sys/types.h#L134
pub base: *mut ::c_char,
pub size: ::c_ulong,
}
pub struct iso_args {
pub fspec: *mut ::c_char,
pub export_info: export_args,
pub flags: ::c_int,
pub sess: ::c_int,
}
pub struct nfs_args {
pub version: ::c_int,
pub addr: *mut ::sockaddr,
pub addrlen: ::c_int,
pub sotype: ::c_int,
pub proto: ::c_int,
pub fh: *mut ::c_uchar,
pub fhsize: ::c_int,
pub flags: ::c_int,
pub wsize: ::c_int,
pub rsize: ::c_int,
pub readdirsize: ::c_int,
pub timeo: ::c_int,
pub retrans: ::c_int,
pub maxgrouplist: ::c_int,
pub readahead: ::c_int,
pub leaseterm: ::c_int,
pub deadthresh: ::c_int,
pub hostname: *mut ::c_char,
pub acregmin: ::c_int,
pub acregmax: ::c_int,
pub acdirmin: ::c_int,
pub acdirmax: ::c_int,
}
pub struct msdosfs_args {
pub fspec: *mut ::c_char,
pub export_info: export_args,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mask: ::mode_t,
pub flags: ::c_int,
}
pub struct ntfs_args {
pub fspec: *mut ::c_char,
pub export_info: export_args,
pub uid: ::uid_t,
pub gid: ::gid_t,
pub mode: ::mode_t,
pub flag: ::c_ulong,
}
pub struct udf_args {
pub fspec: *mut ::c_char,
pub lastblock: u32,
}
pub struct tmpfs_args {
pub ta_version: ::c_int,
pub ta_nodes_max: ::ino_t,
pub ta_size_max: ::off_t,
pub ta_root_uid: ::uid_t,
pub ta_root_gid: ::gid_t,
pub ta_root_mode: ::mode_t,
}
pub struct fusefs_args {
pub name: *mut ::c_char,
pub fd: ::c_int,
pub max_read: ::c_int,
pub allow_other: ::c_int,
}
pub struct xucred {
pub cr_uid: ::uid_t,
pub cr_gid: ::gid_t,
pub cr_ngroups: ::c_short,
//https://github.com/openbsd/src/blob/HEAD/sys/sys/syslimits.h#L44
pub cr_groups: [::gid_t; 16],
}
pub struct export_args {
pub ex_flags: ::c_int,
pub ex_root: ::uid_t,
pub ex_anon: xucred,
pub ex_addr: *mut ::sockaddr,
pub ex_addrlen: ::c_int,
pub ex_mask: *mut ::sockaddr,
pub ex_masklen: ::c_int,
}
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
pub struct in_addr {
pub s_addr: ::in_addr_t,
}
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: ::sa_family_t,
pub sin_port: ::in_port_t,
pub sin_addr: ::in_addr,
pub sin_zero: [i8; 8],
}
pub struct splice {
pub sp_fd: ::c_int,
pub sp_max: ::off_t,
pub sp_idle: ::timeval,
}
pub struct kevent {
pub ident: ::uintptr_t,
pub filter: ::c_short,
pub flags: ::c_ushort,
pub fflags: ::c_uint,
pub data: i64,
pub udata: *mut ::c_void,
}
pub struct stat {
pub st_mode: ::mode_t,
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: u32,
pub st_gen: u32,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
}
pub struct statvfs {
pub f_bsize: ::c_ulong,
pub f_frsize: ::c_ulong,
pub f_blocks: ::fsblkcnt_t,
pub f_bfree: ::fsblkcnt_t,
pub f_bavail: ::fsblkcnt_t,
pub f_files: ::fsfilcnt_t,
pub f_ffree: ::fsfilcnt_t,
pub f_favail: ::fsfilcnt_t,
pub f_fsid: ::c_ulong,
pub f_flag: ::c_ulong,
pub f_namemax: ::c_ulong,
}
pub struct addrinfo {
pub ai_flags: ::c_int,
pub ai_family: ::c_int,
pub ai_socktype: ::c_int,
pub ai_protocol: ::c_int,
pub ai_addrlen: ::socklen_t,
pub ai_addr: *mut ::sockaddr,
pub ai_canonname: *mut ::c_char,
pub ai_next: *mut ::addrinfo,
}
pub struct Dl_info {
pub dli_fname: *const ::c_char,
pub dli_fbase: *mut ::c_void,
pub dli_sname: *const ::c_char,
pub dli_saddr: *mut ::c_void,
}
pub struct if_data {
pub ifi_type: ::c_uchar,
pub ifi_addrlen: ::c_uchar,
pub ifi_hdrlen: ::c_uchar,
pub ifi_link_state: ::c_uchar,
pub ifi_mtu: u32,
pub ifi_metric: u32,
pub ifi_rdomain: u32,
pub ifi_baudrate: u64,
pub ifi_ipackets: u64,
pub ifi_ierrors: u64,
pub ifi_opackets: u64,
pub ifi_oerrors: u64,
pub ifi_collisions: u64,
pub ifi_ibytes: u64,
pub ifi_obytes: u64,
pub ifi_imcasts: u64,
pub ifi_omcasts: u64,
pub ifi_iqdrops: u64,
pub ifi_oqdrops: u64,
pub ifi_noproto: u64,
pub ifi_capabilities: u32,
pub ifi_lastchange: ::timeval,
}
pub struct if_msghdr {
pub ifm_msglen: ::c_ushort,
pub ifm_version: ::c_uchar,
pub ifm_type: ::c_uchar,
pub ifm_hdrlen: ::c_ushort,
pub ifm_index: ::c_ushort,
pub ifm_tableid: ::c_ushort,
pub ifm_pad1: ::c_uchar,
pub ifm_pad2: ::c_uchar,
pub ifm_addrs: ::c_int,
pub ifm_flags: ::c_int,
pub ifm_xflags: ::c_int,
pub ifm_data: if_data,
}
pub struct sockaddr_dl {
pub sdl_len: ::c_uchar,
pub sdl_family: ::c_uchar,
pub sdl_index: ::c_ushort,
pub sdl_type: ::c_uchar,
pub sdl_nlen: ::c_uchar,
pub sdl_alen: ::c_uchar,
pub sdl_slen: ::c_uchar,
pub sdl_data: [::c_char; 24],
}
pub struct sockpeercred {
pub uid: ::uid_t,
pub gid: ::gid_t,
pub pid: ::pid_t,
}
pub struct arphdr {
pub ar_hrd: u16,
pub ar_pro: u16,
pub ar_hln: u8,
pub ar_pln: u8,
pub ar_op: u16,
}
pub struct shmid_ds {
pub shm_perm: ::ipc_perm,
pub shm_segsz: ::c_int,
pub shm_lpid: ::pid_t,
pub shm_cpid: ::pid_t,
pub shm_nattch: ::c_short,
pub shm_atime: ::time_t,
__shm_atimensec: c_long,
pub shm_dtime: ::time_t,
__shm_dtimensec: c_long,
pub shm_ctime: ::time_t,
__shm_ctimensec: c_long,
pub shm_internal: *mut ::c_void,
}
// elf.h
pub struct Elf32_Phdr {
pub p_type: Elf32_Word,
pub p_offset: Elf32_Off,
pub p_vaddr: Elf32_Addr,
pub p_paddr: Elf32_Addr,
pub p_filesz: Elf32_Word,
pub p_memsz: Elf32_Word,
pub p_flags: Elf32_Word,
pub p_align: Elf32_Word,
}
pub struct Elf64_Phdr {
pub p_type: Elf64_Word,
pub p_flags: Elf64_Word,
pub p_offset: Elf64_Off,
pub p_vaddr: Elf64_Addr,
pub p_paddr: Elf64_Addr,
pub p_filesz: Elf64_Xword,
pub p_memsz: Elf64_Xword,
pub p_align: Elf64_Xword,
}
// link.h
pub struct dl_phdr_info {
pub dlpi_addr: Elf_Addr,
pub dlpi_name: *const ::c_char,
pub dlpi_phdr: *const Elf_Phdr,
pub dlpi_phnum: Elf_Half,
}
// sys/sysctl.h
pub struct kinfo_proc {
pub p_forw: u64,
pub p_back: u64,
pub p_paddr: u64,
pub p_addr: u64,
pub p_fd: u64,
pub p_stats: u64,
pub p_limit: u64,
pub p_vmspace: u64,
pub p_sigacts: u64,
pub p_sess: u64,
pub p_tsess: u64,
pub p_ru: u64,
pub p_eflag: i32,
pub p_exitsig: i32,
pub p_flag: i32,
pub p_pid: i32,
pub p_ppid: i32,
pub p_sid: i32,
pub p__pgid: i32,
pub p_tpgid: i32,
pub p_uid: u32,
pub p_ruid: u32,
pub p_gid: u32,
pub p_rgid: u32,
pub p_groups: [u32; KI_NGROUPS as usize],
pub p_ngroups: i16,
pub p_jobc: i16,
pub p_tdev: u32,
pub p_estcpu: u32,
pub p_rtime_sec: u32,
pub p_rtime_usec: u32,
pub p_cpticks: i32,
pub p_pctcpu: u32,
pub p_swtime: u32,
pub p_slptime: u32,
pub p_schedflags: i32,
pub p_uticks: u64,
pub p_sticks: u64,
pub p_iticks: u64,
pub p_tracep: u64,
pub p_traceflag: i32,
pub p_holdcnt: i32,
pub p_siglist: i32,
pub p_sigmask: u32,
pub p_sigignore: u32,
pub p_sigcatch: u32,
pub p_stat: i8,
pub p_priority: u8,
pub p_usrpri: u8,
pub p_nice: u8,
pub p_xstat: u16,
pub p_spare: u16,
pub p_comm: [::c_char; KI_MAXCOMLEN as usize],
pub p_wmesg: [::c_char; KI_WMESGLEN as usize],
pub p_wchan: u64,
pub p_login: [::c_char; KI_MAXLOGNAME as usize],
pub p_vm_rssize: i32,
pub p_vm_tsize: i32,
pub p_vm_dsize: i32,
pub p_vm_ssize: i32,
pub p_uvalid: i64,
pub p_ustart_sec: u64,
pub p_ustart_usec: u32,
pub p_uutime_sec: u32,
pub p_uutime_usec: u32,
pub p_ustime_sec: u32,
pub p_ustime_usec: u32,
pub p_uru_maxrss: u64,
pub p_uru_ixrss: u64,
pub p_uru_idrss: u64,
pub p_uru_isrss: u64,
pub p_uru_minflt: u64,
pub p_uru_majflt: u64,
pub p_uru_nswap: u64,
pub p_uru_inblock: u64,
pub p_uru_oublock: u64,
pub p_uru_msgsnd: u64,
pub p_uru_msgrcv: u64,
pub p_uru_nsignals: u64,
pub p_uru_nvcsw: u64,
pub p_uru_nivcsw: u64,
pub p_uctime_sec: u32,
pub p_uctime_usec: u32,
pub p_psflags: u32,
pub p_acflag: u32,
pub p_svuid: u32,
pub p_svgid: u32,
pub p_emul: [::c_char; KI_EMULNAMELEN as usize],
pub p_rlim_rss_cur: u64,
pub p_cpuid: u64,
pub p_vm_map_size: u64,
pub p_tid: i32,
pub p_rtableid: u32,
pub p_pledge: u64,
pub p_name: [::c_char; KI_MAXCOMLEN as usize],
}
pub struct kinfo_vmentry {
pub kve_start: ::c_ulong,
pub kve_end: ::c_ulong,
pub kve_guard: ::c_ulong,
pub kve_fspace: ::c_ulong,
pub kve_fspace_augment: ::c_ulong,
pub kve_offset: u64,
pub kve_wired_count: ::c_int,
pub kve_etype: ::c_int,
pub kve_protection: ::c_int,
pub kve_max_protection: ::c_int,
pub kve_advice: ::c_int,
pub kve_inheritance: ::c_int,
pub kve_flags: u8,
}
pub struct ptrace_state {
pub pe_report_event: ::c_int,
pub pe_other_pid: ::pid_t,
pub pe_tid: ::pid_t,
}
pub struct ptrace_thread_state {
pub pts_tid: ::pid_t,
}
// search.h
pub struct entry {
pub key: *mut ::c_char,
pub data: *mut ::c_void,
}
pub struct ifreq {
pub ifr_name: [::c_char; ::IFNAMSIZ],
#[cfg(libc_union)]
pub ifr_ifru: __c_anonymous_ifr_ifru,
#[cfg(not(libc_union))]
pub ifr_ifru: ::sockaddr,
}
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
pub __tcpi_retransmits: u8,
pub __tcpi_probes: u8,
pub __tcpi_backoff: u8,
pub tcpi_options: u8,
pub tcpi_snd_wscale: u8,
pub tcpi_rcv_wscale: u8,
pub tcpi_rto: u32,
pub __tcpi_ato: u32,
pub tcpi_snd_mss: u32,
pub tcpi_rcv_mss: u32,
pub __tcpi_unacked: u32,
pub __tcpi_sacked: u32,
pub __tcpi_lost: u32,
pub __tcpi_retrans: u32,
pub __tcpi_fackets: u32,
pub tcpi_last_data_sent: u32,
pub tcpi_last_ack_sent: u32,
pub tcpi_last_data_recv: u32,
pub tcpi_last_ack_recv: u32,
pub __tcpi_pmtu: u32,
pub __tcpi_rcv_ssthresh: u32,
pub tcpi_rtt: u32,
pub tcpi_rttvar: u32,
pub tcpi_snd_ssthresh: u32,
pub tcpi_snd_cwnd: u32,
pub __tcpi_advmss: u32,
pub __tcpi_reordering: u32,
pub __tcpi_rcv_rtt: u32,
pub tcpi_rcv_space: u32,
pub tcpi_snd_wnd: u32,
pub tcpi_snd_nxt: u32,
pub tcpi_rcv_nxt: u32,
pub tcpi_toe_tid: u32,
pub tcpi_snd_rexmitpack: u32,
pub tcpi_rcv_ooopack: u32,
pub tcpi_snd_zerowin: u32,
pub tcpi_rttmin: u32,
pub tcpi_max_sndwnd: u32,
pub tcpi_rcv_adv: u32,
pub tcpi_rcv_up: u32,
pub tcpi_snd_una: u32,
pub tcpi_snd_up: u32,
pub tcpi_snd_wl1: u32,
pub tcpi_snd_wl2: u32,
pub tcpi_snd_max: u32,
pub tcpi_ts_recent: u32,
pub tcpi_ts_recent_age: u32,
pub tcpi_rfbuf_cnt: u32,
pub tcpi_rfbuf_ts: u32,
pub tcpi_so_rcv_sb_cc: u32,
pub tcpi_so_rcv_sb_hiwat: u32,
pub tcpi_so_rcv_sb_lowat: u32,
pub tcpi_so_rcv_sb_wat: u32,
pub tcpi_so_snd_sb_cc: u32,
pub tcpi_so_snd_sb_hiwat: u32,
pub tcpi_so_snd_sb_lowat: u32,
pub tcpi_so_snd_sb_wat: u32,
}
}
impl siginfo_t {
pub unsafe fn si_addr(&self) -> *mut ::c_char {
self.si_addr
}
pub unsafe fn si_code(&self) -> ::c_int {
self.si_code
}
pub unsafe fn si_errno(&self) -> ::c_int {
self.si_errno
}
pub unsafe fn si_pid(&self) -> ::pid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._pid
}
pub unsafe fn si_uid(&self) -> ::uid_t {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
}
(*(self as *const siginfo_t as *const siginfo_timer))._uid
}
pub unsafe fn si_value(&self) -> ::sigval {
#[repr(C)]
struct siginfo_timer {
_si_signo: ::c_int,
_si_code: ::c_int,
_si_errno: ::c_int,
_pad: [::c_int; SI_PAD],
_pid: ::pid_t,
_uid: ::uid_t,
value: ::sigval,
}
(*(self as *const siginfo_t as *const siginfo_timer)).value
}
}
s_no_extra_traits! {
pub struct dirent {
pub d_fileno: ::ino_t,
pub d_off: ::off_t,
pub d_reclen: u16,
pub d_type: u8,
pub d_namlen: u8,
__d_padding: [u8; 4],
pub d_name: [::c_char; 256],
}
pub struct sockaddr_storage {
pub ss_len: u8,
pub ss_family: ::sa_family_t,
__ss_pad1: [u8; 6],
__ss_pad2: i64,
__ss_pad3: [u8; 240],
}
pub struct siginfo_t {
pub si_signo: ::c_int,
pub si_code: ::c_int,
pub si_errno: ::c_int,
pub si_addr: *mut ::c_char,
#[cfg(target_pointer_width = "32")]
__pad: [u8; 112],
#[cfg(target_pointer_width = "64")]
__pad: [u8; 108],
}
pub struct lastlog {
ll_time: ::time_t,
ll_line: [::c_char; UT_LINESIZE],
ll_host: [::c_char; UT_HOSTSIZE],
}
pub struct utmp {
pub ut_line: [::c_char; UT_LINESIZE],
pub ut_name: [::c_char; UT_NAMESIZE],
pub ut_host: [::c_char; UT_HOSTSIZE],
pub ut_time: ::time_t,
}
pub union mount_info {
pub ufs_args: ufs_args,
pub mfs_args: mfs_args,
pub nfs_args: nfs_args,
pub iso_args: iso_args,
pub msdosfs_args: msdosfs_args,
pub ntfs_args: ntfs_args,
pub tmpfs_args: tmpfs_args,
align: [::c_char; 160],
}
#[cfg(libc_union)]
pub union __c_anonymous_ifr_ifru {
pub ifru_addr: ::sockaddr,
pub ifru_dstaddr: ::sockaddr,
pub ifru_broadaddr: ::sockaddr,
pub ifru_flags: ::c_short,
pub ifru_metric: ::c_int,
pub ifru_vnetid: i64,
pub ifru_media: u64,
pub ifru_data: ::caddr_t,
pub ifru_index: ::c_uint,
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for dirent {
fn eq(&self, other: &dirent) -> bool {
self.d_fileno == other.d_fileno
&& self.d_off == other.d_off
&& self.d_reclen == other.d_reclen
&& self.d_type == other.d_type
&& self.d_namlen == other.d_namlen
&& self
.d_name
.iter()
.zip(other.d_name.iter())
.all(|(a,b)| a == b)
}
}
impl Eq for dirent {}
impl ::fmt::Debug for dirent {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("dirent")
.field("d_fileno", &self.d_fileno)
.field("d_off", &self.d_off)
.field("d_reclen", &self.d_reclen)
.field("d_type", &self.d_type)
.field("d_namlen", &self.d_namlen)
// FIXME: .field("d_name", &self.d_name)
.finish()
}
}
impl ::hash::Hash for dirent {
fn hash(&self, state: &mut H) {
self.d_fileno.hash(state);
self.d_off.hash(state);
self.d_reclen.hash(state);
self.d_type.hash(state);
self.d_namlen.hash(state);
self.d_name.hash(state);
}
}
impl PartialEq for sockaddr_storage {
fn eq(&self, other: &sockaddr_storage) -> bool {
self.ss_len == other.ss_len
&& self.ss_family == other.ss_family
}
}
impl Eq for sockaddr_storage {}
impl ::fmt::Debug for sockaddr_storage {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("sockaddr_storage")
.field("ss_len", &self.ss_len)
.field("ss_family", &self.ss_family)
.finish()
}
}
impl ::hash::Hash for sockaddr_storage {
fn hash