🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

libc

Package Overview
Dependencies
Maintainers
0
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libc - cargo Package Compare versions

Comparing version
0.2.161
to
0.2.162
+101
src/trusty.rs
pub use core::ffi::c_void;
pub type size_t = usize;
pub type ssize_t = isize;
pub type off_t = i64;
cfg_if! {
if #[cfg(any(target_arch = "aarch64", target_arch = "arm"))] {
pub type c_char = u8;
} else if #[cfg(target_arch = "x86_64")] {
pub type c_char = i8;
}
}
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;
cfg_if! {
if #[cfg(target_pointer_width = "32")] {
pub type c_long = i32;
pub type c_ulong = u32;
} else if #[cfg(target_pointer_width = "64")] {
pub type c_long = i64;
pub type c_ulong = u64;
}
}
pub type c_longlong = i64;
pub type c_ulonglong = u64;
pub type c_uint8_t = u8;
pub type c_uint16_t = u16;
pub type c_uint32_t = u32;
pub type c_uint64_t = u64;
pub type c_int8_t = i8;
pub type c_int16_t = i16;
pub type c_int32_t = i32;
pub type c_int64_t = i64;
pub type c_float = f32;
pub type c_double = f64;
pub type time_t = c_long;
pub type clockid_t = c_int;
s! {
pub struct iovec {
pub iov_base: *mut ::c_void,
pub iov_len: ::size_t,
}
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: c_long,
}
}
pub const PROT_READ: i32 = 1;
pub const PROT_WRITE: i32 = 2;
// Trusty only supports `CLOCK_BOOTTIME`.
pub const CLOCK_BOOTTIME: clockid_t = 7;
pub const STDOUT_FILENO: ::c_int = 1;
pub const STDERR_FILENO: ::c_int = 2;
pub const AT_PAGESZ: ::c_ulong = 6;
pub const MAP_FAILED: *mut ::c_void = !0 as *mut ::c_void;
extern "C" {
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 memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int;
pub fn write(fd: ::c_int, buf: *const ::c_void, count: ::size_t) -> ::ssize_t;
pub fn writev(fd: ::c_int, iov: *const ::iovec, iovcnt: ::c_int) -> ::ssize_t;
pub fn close(fd: ::c_int) -> ::c_int;
pub fn strlen(cs: *const c_char) -> size_t;
pub fn getauxval(type_: c_ulong) -> c_ulong;
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 clock_gettime(clk_id: ::clockid_t, tp: *mut ::timespec) -> ::c_int;
pub fn nanosleep(rqtp: *const ::timespec, rmtp: *mut ::timespec) -> ::c_int;
}
+1
-1
{
"git": {
"sha1": "63b4a641b774f451d4faa2e1b8d3ec0fe7e03c44"
"sha1": "b8c255c8a6ce49dfc4266cc88f4d44037098b5a5"
},
"path_in_vcs": ""
}

@@ -10,3 +10,3 @@ use std::env;

"emscripten_new_stat_abi",
"espidf_time64",
"espidf_time32",
"freebsd10",

@@ -13,0 +13,0 @@ "freebsd11",

@@ -14,3 +14,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "libc"
version = "0.2.161"
version = "0.2.162"
authors = ["The Rust Project Developers"]

@@ -143,3 +143,2 @@ build = "build.rs"

"wasm32-unknown-unknown",
"wasm32-wasi",
"x86_64-apple-darwin",

@@ -146,0 +145,0 @@ "x86_64-apple-ios",

@@ -5,2 +5,40 @@ # Changelog

## [0.2.162](https://github.com/rust-lang/libc/compare/0.2.161...0.2.162) - 2024-11-07
### Added
- Android: fix the alignment of `uc_mcontext` on arm64 <https://github.com/rust-lang/libc/pull/3894>
- Apple: add `host_cpu_load_info` <https://github.com/rust-lang/libc/pull/3916>
- ESP-IDF: add a time flag <https://github.com/rust-lang/libc/pull/3993>
- FreeBSD: add the `CLOSE_RANGE_CLOEXEC` flag<https://github.com/rust-lang/libc/pull/3996>
- FreeBSD: fix test errors regarding `__gregset_t` <https://github.com/rust-lang/libc/pull/3995>
- FreeBSD: fix tests on x86 FreeBSD 15 <https://github.com/rust-lang/libc/pull/3948>
- FreeBSD: make `ucontext_t` and `mcontext_t` available on all architectures <https://github.com/rust-lang/libc/pull/3848>
- Haiku: add `getentropy` <https://github.com/rust-lang/libc/pull/3991>
- Illumos: add `syncfs` <https://github.com/rust-lang/libc/pull/3990>
- Illumos: add some recently-added constants <https://github.com/rust-lang/libc/pull/3999>
- Linux: add `ioctl` flags <https://github.com/rust-lang/libc/pull/3960>
- Linux: add epoll busy polling parameters <https://github.com/rust-lang/libc/pull/3922>
- NuttX: add `pthread_[get/set]name_np` <https://github.com/rust-lang/libc/pull/4003>
- RTEMS: add `arc4random_buf` <https://github.com/rust-lang/libc/pull/3989>
- Trusty OS: add initial support <https://github.com/rust-lang/libc/pull/3942>
- WASIp2: expand socket support <https://github.com/rust-lang/libc/pull/3981>
### Fixed
- Emscripten: don't pass `-lc` <https://github.com/rust-lang/libc/pull/4002>
- Hurd: change `st_fsid` field to `st_dev` <https://github.com/rust-lang/libc/pull/3785>
- Hurd: fix the definition of `utsname` <https://github.com/rust-lang/libc/pull/3992>
- Illumos/Solaris: fix `FNM_CASEFOLD` definition <https://github.com/rust-lang/libc/pull/4004>
- Solaris: fix all tests <https://github.com/rust-lang/libc/pull/3864>
### Other
- CI: Add loongarch64 <https://github.com/rust-lang/libc/pull/4000>
- CI: Check that semver files are sorted <https://github.com/rust-lang/libc/pull/4018>
- CI: Re-enable the FreeBSD 15 job <https://github.com/rust-lang/libc/pull/3988>
- Clean up imports and `extern crate` usage <https://github.com/rust-lang/libc/pull/3897>
- Convert `mode_t` constants to octal <https://github.com/rust-lang/libc/pull/3634>
- Remove the `wasm32-wasi` target that has been deleted upstream <https://github.com/rust-lang/libc/pull/4013>
## [0.2.161](https://github.com/rust-lang/libc/compare/0.2.160...0.2.161) - 2024-10-17

@@ -7,0 +45,0 @@

# Contributing to `libc`
Welcome! If you are reading this document, it means you are interested in contributing
to the `libc` crate.
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.
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.

@@ -19,10 +19,10 @@ ## Adding an API

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.
`#[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.
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

@@ -59,3 +59,4 @@ particular level in the hierarchy means that it is supported on all the child

We have two automated tests running on [GitHub Actions](https://github.com/rust-lang/libc/actions):
We have two automated tests running on
[GitHub Actions](https://github.com/rust-lang/libc/actions):

@@ -70,14 +71,16 @@ 1. [`libc-test`](https://github.com/gnzlbg/ctest)

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:
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").
- 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.

@@ -87,18 +90,11 @@

When Rust removes a support for a target, the libc crate also may remove the support anytime.
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:
This repository uses [release-plz] to handle releases. Once your pull request
has been merged, a maintainer just needs to verify the generated changelog, then
merge the bot's release PR. This will automatically publish to crates.io!
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
[release-plz]: https://github.com/MarcoIeni/release-plz
+34
-34

@@ -14,4 +14,4 @@ # libc - Raw FFI bindings to platforms' system libraries

Windows API bindings are not included in this crate. If you are looking for WinAPI
bindings, consider using crates like [windows-sys].
Windows API bindings are not included in this crate. If you are looking for
WinAPI bindings, consider using crates like [windows-sys].

@@ -28,6 +28,7 @@ More detailed information about the design of this library can be found in its

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.
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.
See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for
details.

@@ -45,5 +46,4 @@ ## Usage

* `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.
* `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.

@@ -53,5 +53,5 @@ * `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`.

* `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.
* `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.

@@ -62,27 +62,27 @@ * **deprecated**: `use_std` is deprecated, and is equivalent to `std`.

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:
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 |
| -------------------- | ------- |
| `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.
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.
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.

@@ -105,9 +105,9 @@ <div class="platform_docs"></div>

We welcome all people who want to contribute. Please see the [contributing
instructions] for more information.
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].
Contributions in any form (issues, pull requests, etc.) to this project must
adhere to Rust's [Code of Conduct].

@@ -114,0 +114,0 @@ [Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct

@@ -148,2 +148,8 @@ //! libc - Raw FFI bindings to platforms' system libraries

pub use teeos::*;
} else if #[cfg(target_os = "trusty")] {
mod fixed_width_ints;
pub use fixed_width_ints::*;
mod trusty;
pub use trusty::*;
} else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] {

@@ -150,0 +156,0 @@ mod fixed_width_ints;

@@ -212,11 +212,11 @@ //! Interface to the [SOLID] C library

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 S_IEXEC: c_short = 0o0100;
pub const S_IWRITE: c_short = 0o0200;
pub const S_IREAD: c_short = 0o0400;
pub const S_IFCHR: c_short = 0o2_0000;
pub const S_IFDIR: c_short = 0o4_0000;
pub const S_IFMT: c_short = 0o16_0000;
pub const S_IFIFO: c_short = 0o1_0000;
pub const S_IFBLK: c_short = 0o6_0000;
pub const S_IFREG: c_short = 0o10_0000;

@@ -223,0 +223,0 @@ pub const LC_ALL: c_int = 0;

@@ -1465,2 +1465,3 @@ pub type dev_t = u32;

pub const TIOCREMOTE: ::c_ulong = 0x80047469;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

@@ -1467,0 +1468,0 @@ // Constants used by "at" family of system calls.

pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type clock_t = i32;
pub type wchar_t = u32;

@@ -145,3 +146,6 @@ pub type time_t = i64;

pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = u32;
pub type wchar_t = u32;

@@ -8,3 +9,46 @@ pub type time_t = i64;

pub type register_t = i32;
pub type __greg_t = ::c_uint;
pub type __gregset_t = [::__greg_t; 17];
s_no_extra_traits! {
pub struct mcontext_t {
pub __gregs: ::__gregset_t,
pub mc_vfp_size: usize,
pub mc_vfp_ptr: *mut ::c_void,
pub mc_spare: [::c_uint; 33],
}
}
cfg_if! {
if #[cfg(feature = "extra_traits")] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.__gregs == other.__gregs &&
self.mc_vfp_size == other.mc_vfp_size &&
self.mc_vfp_ptr == other.mc_vfp_ptr &&
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("__gregs", &self.__gregs)
.field("mc_vfp_size", &self.mc_vfp_size)
.field("mc_vfp_ptr", &self.mc_vfp_ptr)
.field("mc_spare", &self.mc_spare)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.__gregs.hash(state);
self.mc_vfp_size.hash(state);
self.mc_vfp_ptr.hash(state);
self.mc_spare.hash(state);
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0

@@ -20,3 +64,7 @@ cfg_if! {

}
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

@@ -44,3 +44,6 @@ // APIs in FreeBSD 13 that have changed since 11.

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

@@ -47,0 +50,0 @@

@@ -44,3 +44,6 @@ // APIs in FreeBSD 14 that have changed since 11.

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

@@ -47,0 +50,0 @@

@@ -44,3 +44,6 @@ // APIs in FreeBSD 15 that have changed since 11.

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

@@ -47,0 +50,0 @@

pub type c_char = u8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = u32;
pub type wchar_t = i32;

@@ -9,2 +10,68 @@ pub type time_t = i64;

cfg_if! {
if #[cfg(libc_align)] {
s_no_extra_traits! {
#[repr(align(16))]
pub struct mcontext_t {
pub mc_vers: ::c_int,
pub mc_flags: ::c_int,
pub mc_onstack: ::c_int,
pub mc_len: ::c_int,
pub mc_avec: [u64; 64],
pub mc_av: [u32; 2],
pub mc_frame: [::register_t; 42],
pub mc_fpreg: [u64; 33],
pub mc_vsxfpreg: [u64; 32],
}
}
}
}
cfg_if! {
if #[cfg(all(libc_align, feature = "extra_traits"))] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_vers == other.mc_vers &&
self.mc_flags == other.mc_flags &&
self.mc_onstack == other.mc_onstack &&
self.mc_len == other.mc_len &&
self.mc_avec == other.mc_avec &&
self.mc_av == other.mc_av &&
self.mc_frame == other.mc_frame &&
self.mc_fpreg == other.mc_fpreg &&
self.mc_vsxfpreg == other.mc_vsxfpreg
}
}
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_vers", &self.mc_vers)
.field("mc_flags", &self.mc_flags)
.field("mc_onstack", &self.mc_onstack)
.field("mc_len", &self.mc_len)
.field("mc_avec", &self.mc_avec)
.field("mc_av", &self.mc_av)
.field("mc_frame", &self.mc_frame)
.field("mc_fpreg", &self.mc_fpreg)
.field("mc_vsxfpreg", &self.mc_vsxfpreg)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_vers.hash(state);
self.mc_flags.hash(state);
self.mc_onstack.hash(state);
self.mc_len.hash(state);
self.mc_avec.hash(state);
self.mc_av.hash(state);
self.mc_frame.hash(state);
self.mc_fpreg.hash(state);
self.mc_vsxfpreg.hash(state);
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0

@@ -21,3 +88,6 @@ cfg_if! {

pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type clock_t = u32;
pub type wchar_t = i32;

@@ -9,2 +10,68 @@ pub type time_t = i64;

cfg_if! {
if #[cfg(libc_align)] {
s_no_extra_traits! {
#[repr(align(16))]
pub struct mcontext_t {
pub mc_vers: ::c_int,
pub mc_flags: ::c_int,
pub mc_onstack: ::c_int,
pub mc_len: ::c_int,
pub mc_avec: [u64; 64],
pub mc_av: [u32; 2],
pub mc_frame: [::register_t; 42],
pub mc_fpreg: [u64; 33],
pub mc_vsxfpreg: [u64; 32],
}
}
}
}
cfg_if! {
if #[cfg(all(libc_align, feature = "extra_traits"))] {
impl PartialEq for mcontext_t {
fn eq(&self, other: &mcontext_t) -> bool {
self.mc_vers == other.mc_vers &&
self.mc_flags == other.mc_flags &&
self.mc_onstack == other.mc_onstack &&
self.mc_len == other.mc_len &&
self.mc_avec == other.mc_avec &&
self.mc_av == other.mc_av &&
self.mc_frame == other.mc_frame &&
self.mc_fpreg == other.mc_fpreg &&
self.mc_vsxfpreg == other.mc_vsxfpreg
}
}
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_vers", &self.mc_vers)
.field("mc_flags", &self.mc_flags)
.field("mc_onstack", &self.mc_onstack)
.field("mc_len", &self.mc_len)
.field("mc_avec", &self.mc_avec)
.field("mc_av", &self.mc_av)
.field("mc_frame", &self.mc_frame)
.field("mc_fpreg", &self.mc_fpreg)
.field("mc_vsxfpreg", &self.mc_vsxfpreg)
.finish()
}
}
impl ::hash::Hash for mcontext_t {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.mc_vers.hash(state);
self.mc_flags.hash(state);
self.mc_onstack.hash(state);
self.mc_len.hash(state);
self.mc_avec.hash(state);
self.mc_av.hash(state);
self.mc_frame.hash(state);
self.mc_fpreg.hash(state);
self.mc_vsxfpreg.hash(state);
}
}
}
}
// should be pub(crate), but that requires Rust 1.18.0

@@ -21,3 +88,6 @@ cfg_if! {

pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
pub type c_char = u8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type clock_t = i32;
pub type wchar_t = ::c_int;

@@ -153,3 +154,6 @@ pub type time_t = i64;

pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

@@ -187,12 +187,1 @@ use {c_long, register_t};

}
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],
}
}
pub type c_char = i8;
pub type c_long = i64;
pub type c_ulong = u64;
pub type clock_t = i32;
pub type wchar_t = i32;

@@ -252,2 +253,6 @@ pub type time_t = i64;

}
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
pub const MAP_32BIT: ::c_int = 0x00080000;

@@ -269,2 +274,4 @@ pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4

pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
cfg_if! {

@@ -271,0 +278,0 @@ if #[cfg(libc_align)] {

pub type c_char = i8;
pub type c_long = i32;
pub type c_ulong = u32;
pub type clock_t = ::c_ulong;
pub type wchar_t = i32;

@@ -9,48 +10,42 @@ pub type time_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],
cfg_if! {
if #[cfg(libc_align)] {
s_no_extra_traits! {
#[repr(align(16))]
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; 128],
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 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

@@ -68,3 +63,3 @@ cfg_if! {

cfg_if! {
if #[cfg(feature = "extra_traits")] {
if #[cfg(all(libc_align, feature = "extra_traits"))] {
impl PartialEq for mcontext_t {

@@ -132,3 +127,4 @@ fn eq(&self, other: &mcontext_t) -> bool {

.field("mc_flags", &self.mc_flags)
.field("mc_fpstate", &self.mc_fpstate)
// FIXME(msrv) debug not supported for arrays in old MSRV
// .field("mc_fpstate", &self.mc_fpstate)
.field("mc_fsbase", &self.mc_fsbase)

@@ -181,2 +177,5 @@ .field("mc_gsbase", &self.mc_gsbase)

pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
pub const KINFO_FILE_SIZE: ::c_int = 1392;
pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;

@@ -176,25 +176,25 @@ pub type wchar_t = i32;

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 S_IFIFO: mode_t = 0o1_0000;
pub const S_IFCHR: mode_t = 0o2_0000;
pub const S_IFBLK: mode_t = 0o6_0000;
pub const S_IFDIR: mode_t = 0o4_0000;
pub const S_IFREG: mode_t = 0o10_0000;
pub const S_IFLNK: mode_t = 0o12_0000;
pub const S_IFSOCK: mode_t = 0o14_0000;
pub const S_IFMT: mode_t = 0o17_0000;
pub const S_IEXEC: mode_t = 0o0100;
pub const S_IWRITE: mode_t = 0o0200;
pub const S_IREAD: mode_t = 0o0400;
pub const S_IRWXU: mode_t = 0o0700;
pub const S_IXUSR: mode_t = 0o0100;
pub const S_IWUSR: mode_t = 0o0200;
pub const S_IRUSR: mode_t = 0o0400;
pub const S_IRWXG: mode_t = 0o0070;
pub const S_IXGRP: mode_t = 0o0010;
pub const S_IWGRP: mode_t = 0o0020;
pub const S_IRGRP: mode_t = 0o0040;
pub const S_IRWXO: mode_t = 0o0007;
pub const S_IXOTH: mode_t = 0o0001;
pub const S_IWOTH: mode_t = 0o0002;
pub const S_IROTH: mode_t = 0o0004;
pub const F_OK: ::c_int = 0;

@@ -201,0 +201,0 @@ pub const R_OK: ::c_int = 4;

@@ -7,5 +7,4 @@ s_no_extra_traits! {

}
}
s! {
#[allow(missing_debug_implementations)]
pub struct ucontext_t {

@@ -16,5 +15,8 @@ pub uc_flags: ::c_ulong,

pub uc_sigmask: ::sigset_t,
pub __pad: [u8; 1024 / 8 - ::core::mem::size_of::<::sigset_t>()],
pub uc_mcontext: mcontext_t,
}
}
s! {
#[repr(align(16))]

@@ -21,0 +23,0 @@ pub struct mcontext_t {

@@ -780,5 +780,5 @@ pub type c_char = i8;

pub const S_IEXEC: mode_t = 64;
pub const S_IWRITE: mode_t = 128;
pub const S_IREAD: mode_t = 256;
pub const S_IEXEC: mode_t = 0o0100;
pub const S_IWRITE: mode_t = 0o0200;
pub const S_IREAD: mode_t = 0o0400;

@@ -785,0 +785,0 @@ pub const F_LOCK: ::c_int = 1;

@@ -213,2 +213,30 @@ s! {

pub const BLKPBSZGET: ::Ioctl = 0x127B;
// linux/if_tun.h
pub const TUNSETNOCSUM: ::Ioctl = 0x400454c8;
pub const TUNSETDEBUG: ::Ioctl = 0x400454c9;
pub const TUNSETIFF: ::Ioctl = 0x400454ca;
pub const TUNSETPERSIST: ::Ioctl = 0x400454cb;
pub const TUNSETOWNER: ::Ioctl = 0x400454cc;
pub const TUNSETLINK: ::Ioctl = 0x400454cd;
pub const TUNSETGROUP: ::Ioctl = 0x400454ce;
pub const TUNGETFEATURES: ::Ioctl = 0x800454cf;
pub const TUNSETOFFLOAD: ::Ioctl = 0x400454d0;
pub const TUNSETTXFILTER: ::Ioctl = 0x400454d1;
pub const TUNGETIFF: ::Ioctl = 0x800454d2;
pub const TUNGETSNDBUF: ::Ioctl = 0x800454d3;
pub const TUNSETSNDBUF: ::Ioctl = 0x400454d4;
pub const TUNGETVNETHDRSZ: ::Ioctl = 0x800454d7;
pub const TUNSETVNETHDRSZ: ::Ioctl = 0x400454d8;
pub const TUNSETQUEUE: ::Ioctl = 0x400454d9;
pub const TUNSETIFINDEX: ::Ioctl = 0x400454da;
pub const TUNSETVNETLE: ::Ioctl = 0x400454dc;
pub const TUNGETVNETLE: ::Ioctl = 0x800454dd;
/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on
* little-endian hosts. Not all kernel configurations support them, but all
* configurations that support SET also support GET.
*/
pub const TUNSETVNETBE: ::Ioctl = 0x400454de;
pub const TUNGETVNETBE: ::Ioctl = 0x800454df;
pub const TUNSETSTEERINGEBPF: ::Ioctl = 0x800454e0;
pub const TUNSETFILTEREBPF: ::Ioctl = 0x800454e1;

@@ -231,2 +259,5 @@ cfg_if! {

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x400854d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x400854d6;
pub const TUNGETFILTER: ::Ioctl = 0x800854db;
} else if #[cfg(any(target_arch = "x86_64",

@@ -245,2 +276,5 @@ target_arch = "riscv64",

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x40047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x401054d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x401054d6;
pub const TUNGETFILTER: ::Ioctl = 0x801054db;
}

@@ -247,0 +281,0 @@ }

@@ -195,2 +195,30 @@ s! {

pub const BLKPBSZGET: ::Ioctl = 0x2000127B;
// linux/if_tun.h
pub const TUNSETNOCSUM: ::Ioctl = 0x800454c8;
pub const TUNSETDEBUG: ::Ioctl = 0x800454c9;
pub const TUNSETIFF: ::Ioctl = 0x800454ca;
pub const TUNSETPERSIST: ::Ioctl = 0x800454cb;
pub const TUNSETOWNER: ::Ioctl = 0x800454cc;
pub const TUNSETLINK: ::Ioctl = 0x800454cd;
pub const TUNSETGROUP: ::Ioctl = 0x800454ce;
pub const TUNGETFEATURES: ::Ioctl = 0x400454cf;
pub const TUNSETOFFLOAD: ::Ioctl = 0x800454d0;
pub const TUNSETTXFILTER: ::Ioctl = 0x800454d1;
pub const TUNGETIFF: ::Ioctl = 0x400454d2;
pub const TUNGETSNDBUF: ::Ioctl = 0x400454d3;
pub const TUNSETSNDBUF: ::Ioctl = 0x800454d4;
pub const TUNGETVNETHDRSZ: ::Ioctl = 0x400454d7;
pub const TUNSETVNETHDRSZ: ::Ioctl = 0x800454d8;
pub const TUNSETQUEUE: ::Ioctl = 0x800454d9;
pub const TUNSETIFINDEX: ::Ioctl = 0x800454da;
pub const TUNSETVNETLE: ::Ioctl = 0x800454dc;
pub const TUNGETVNETLE: ::Ioctl = 0x400454dd;
/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on
* little-endian hosts. Not all kernel configurations support them, but all
* configurations that support SET also support GET.
*/
pub const TUNSETVNETBE: ::Ioctl = 0x800454de;
pub const TUNGETVNETBE: ::Ioctl = 0x400454df;
pub const TUNSETSTEERINGEBPF: ::Ioctl = 0x400454e0;
pub const TUNSETFILTEREBPF: ::Ioctl = 0x400454e1;

@@ -213,2 +241,5 @@ cfg_if! {

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x800854d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x800854d6;
pub const TUNGETFILTER: ::Ioctl = 0x400854db;
} else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] {

@@ -223,2 +254,5 @@ pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x801054d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x801054d6;
pub const TUNGETFILTER: ::Ioctl = 0x401054db;
}

@@ -225,0 +259,0 @@ }

@@ -181,2 +181,30 @@ // arch/powerpc/include/uapi/asm/socket.h

//pub const FIOQSIZE: ::Ioctl = 0x40086680;
// linux/if_tun.h
pub const TUNSETNOCSUM: ::Ioctl = 0x800454c8;
pub const TUNSETDEBUG: ::Ioctl = 0x800454c9;
pub const TUNSETIFF: ::Ioctl = 0x800454ca;
pub const TUNSETPERSIST: ::Ioctl = 0x800454cb;
pub const TUNSETOWNER: ::Ioctl = 0x800454cc;
pub const TUNSETLINK: ::Ioctl = 0x800454cd;
pub const TUNSETGROUP: ::Ioctl = 0x800454ce;
pub const TUNGETFEATURES: ::Ioctl = 0x400454cf;
pub const TUNSETOFFLOAD: ::Ioctl = 0x800454d0;
pub const TUNSETTXFILTER: ::Ioctl = 0x800454d1;
pub const TUNGETIFF: ::Ioctl = 0x400454d2;
pub const TUNGETSNDBUF: ::Ioctl = 0x400454d3;
pub const TUNSETSNDBUF: ::Ioctl = 0x800454d4;
pub const TUNGETVNETHDRSZ: ::Ioctl = 0x400454d7;
pub const TUNSETVNETHDRSZ: ::Ioctl = 0x800454d8;
pub const TUNSETQUEUE: ::Ioctl = 0x800454d9;
pub const TUNSETIFINDEX: ::Ioctl = 0x800454da;
pub const TUNSETVNETLE: ::Ioctl = 0x800454dc;
pub const TUNGETVNETLE: ::Ioctl = 0x400454dd;
/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on
* little-endian hosts. Not all kernel configurations support them, but all
* configurations that support SET also support GET.
*/
pub const TUNSETVNETBE: ::Ioctl = 0x800454de;
pub const TUNGETVNETBE: ::Ioctl = 0x400454df;
pub const TUNSETSTEERINGEBPF: ::Ioctl = 0x400454e0;
pub const TUNSETFILTEREBPF: ::Ioctl = 0x400454e1;

@@ -199,2 +227,5 @@ cfg_if! {

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x800854d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x800854d6;
pub const TUNGETFILTER: ::Ioctl = 0x400854db;
} else if #[cfg(target_arch = "powerpc64")] {

@@ -209,2 +240,5 @@ pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x801054d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x801054d6;
pub const TUNGETFILTER: ::Ioctl = 0x401054db;
}

@@ -211,0 +245,0 @@ }

@@ -186,2 +186,31 @@ s! {

// linux/if_tun.h
pub const TUNSETNOCSUM: ::Ioctl = 0x800454c8;
pub const TUNSETDEBUG: ::Ioctl = 0x800454c9;
pub const TUNSETIFF: ::Ioctl = 0x800454ca;
pub const TUNSETPERSIST: ::Ioctl = 0x800454cb;
pub const TUNSETOWNER: ::Ioctl = 0x800454cc;
pub const TUNSETLINK: ::Ioctl = 0x800454cd;
pub const TUNSETGROUP: ::Ioctl = 0x800454ce;
pub const TUNGETFEATURES: ::Ioctl = 0x400454cf;
pub const TUNSETOFFLOAD: ::Ioctl = 0x800454d0;
pub const TUNSETTXFILTER: ::Ioctl = 0x800454d1;
pub const TUNGETIFF: ::Ioctl = 0x400454d2;
pub const TUNGETSNDBUF: ::Ioctl = 0x400454d3;
pub const TUNSETSNDBUF: ::Ioctl = 0x800454d4;
pub const TUNGETVNETHDRSZ: ::Ioctl = 0x400454d7;
pub const TUNSETVNETHDRSZ: ::Ioctl = 0x800454d8;
pub const TUNSETQUEUE: ::Ioctl = 0x800454d9;
pub const TUNSETIFINDEX: ::Ioctl = 0x800454da;
pub const TUNSETVNETLE: ::Ioctl = 0x800454dc;
pub const TUNGETVNETLE: ::Ioctl = 0x400454dd;
/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on
* little-endian hosts. Not all kernel configurations support them, but all
* configurations that support SET also support GET.
*/
pub const TUNSETVNETBE: ::Ioctl = 0x800454de;
pub const TUNGETVNETBE: ::Ioctl = 0x400454df;
pub const TUNSETSTEERINGEBPF: ::Ioctl = 0x400454e0;
pub const TUNSETFILTEREBPF: ::Ioctl = 0x400454e1;
pub const TIOCM_LE: ::c_int = 0x001;

@@ -250,2 +279,5 @@ pub const TIOCM_DTR: ::c_int = 0x002;

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x800854d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x800854d6;
pub const TUNGETFILTER: ::Ioctl = 0x400854db;
} else if #[cfg(target_arch = "sparc64")] {

@@ -260,3 +292,6 @@ pub const FS_IOC_GETFLAGS: ::Ioctl = 0x40086601;

pub const FS_IOC32_SETVERSION: ::Ioctl = 0x80047602;
pub const TUNATTACHFILTER: ::Ioctl = 0x801054d5;
pub const TUNDETACHFILTER: ::Ioctl = 0x801054d6;
pub const TUNGETFILTER: ::Ioctl = 0x401054db;
}
}

@@ -1301,2 +1301,25 @@ pub type pthread_t = c_ulong;

cfg_if! {
if #[cfg(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "loongarch64",
target_arch = "riscv64",
target_arch = "s390x"))] {
pub const TUNSETCARRIER: ::Ioctl = 0x400454e2;
pub const TUNGETDEVNETNS: ::Ioctl = 0x54e3;
} else if #[cfg(any(target_arch = "mips",
target_arch = "mips64",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "sparc",
target_arch = "sparc64"))] {
pub const TUNSETCARRIER: ::Ioctl = 0x800454e2;
pub const TUNGETDEVNETNS: ::Ioctl = 0x200054e3;
} else {
// Unknown target_arch
}
}
extern "C" {

@@ -1303,0 +1326,0 @@ pub fn fgetspent_r(

@@ -238,5 +238,5 @@ //! Definitions found commonly among almost all Unix derivatives

pub const S_ISUID: ::mode_t = 0x800;
pub const S_ISGID: ::mode_t = 0x400;
pub const S_ISVTX: ::mode_t = 0x200;
pub const S_ISUID: ::mode_t = 0o4000;
pub const S_ISGID: ::mode_t = 0o2000;
pub const S_ISVTX: ::mode_t = 0o1000;

@@ -318,3 +318,2 @@ cfg_if! {

pub const FNM_PERIOD: c_int = 1 << 2;
pub const FNM_CASEFOLD: c_int = 1 << 4;
pub const FNM_NOMATCH: c_int = 1;

@@ -324,2 +323,13 @@

if #[cfg(any(
target_os = "illumos",
target_os = "solaris",
))] {
pub const FNM_CASEFOLD: c_int = 1 << 3;
} else {
pub const FNM_CASEFOLD: c_int = 1 << 4;
}
}
cfg_if! {
if #[cfg(any(
target_os = "macos",

@@ -388,4 +398,4 @@ target_os = "freebsd",

} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
// Don't pass -lc to Emscripten, it breaks. See:
// https://github.com/emscripten-core/emscripten/issues/22758
} else if #[cfg(all(target_os = "android", feature = "rustc-dep-of-std"))] {

@@ -629,6 +639,4 @@ #[link(name = "c", kind = "static", modifiers = "-bundle",

#[cfg_attr(target_os = "netbsd", link_name = "__socket30")]
#[cfg_attr(
any(target_os = "illumos", target_os = "solaris"),
link_name = "__xnet_socket"
)]
#[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")]
#[cfg_attr(target_os = "solaris", link_name = "__xnet7_socket")]
#[cfg_attr(target_os = "espidf", link_name = "lwip_socket")]

@@ -939,2 +947,3 @@ pub fn socket(domain: ::c_int, ty: ::c_int, protocol: ::c_int) -> ::c_int;

pub fn isatty(fd: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "solaris", link_name = "__link_xpg4")]
pub fn link(src: *const c_char, dst: *const c_char) -> ::c_int;

@@ -977,3 +986,6 @@ pub fn lseek(fd: ::c_int, offset: off_t, whence: ::c_int) -> off_t;

)]
#[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
#[cfg_attr(
any(target_os = "illumos", target_os = "solaris"),
link_name = "__posix_ttyname_r"
)]
pub fn ttyname_r(fd: ::c_int, buf: *mut c_char, buflen: ::size_t) -> ::c_int;

@@ -1099,4 +1111,2 @@ pub fn unlink(c: *const c_char) -> ::c_int;

pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
#[cfg_attr(target_os = "netbsd", link_name = "__times13")]

@@ -1410,2 +1420,3 @@ pub fn times(buf: *mut ::tms) -> ::clock_t;

#[cfg_attr(target_os = "solaris", link_name = "__sysconf_xpg7")]
pub fn sysconf(name: ::c_int) -> ::c_long;

@@ -1464,6 +1475,11 @@

target_os = "haiku",
target_os = "nto")))] {
target_os = "nto",
target_os = "solaris")))] {
extern "C" {
pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> ::c_int;
}
} else if #[cfg(target_os = "solaris")] {
extern "C" {
pub fn adjtime(delta: *mut timeval, olddelta: *mut timeval) -> ::c_int;
}
}

@@ -1491,2 +1507,10 @@ }

cfg_if! {
if #[cfg(not(target_os = "solaris"))] {
extern "C" {
pub fn flock(fd: ::c_int, operation: ::c_int) -> ::c_int;
}
}
}
cfg_if! {
if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] {

@@ -1493,0 +1517,0 @@ extern "C" {

@@ -55,3 +55,3 @@ pub type blkcnt_t = i32;

cfg_if! {
if #[cfg(any(target_os = "horizon", all(target_os = "espidf", espidf_time64)))] {
if #[cfg(any(target_os = "horizon", all(target_os = "espidf", not(espidf_time32))))] {
pub type time_t = ::c_longlong;

@@ -483,23 +483,23 @@ } else {

pub const S_BLKSIZE: ::mode_t = 1024;
pub const S_IREAD: ::mode_t = 256;
pub const S_IWRITE: ::mode_t = 128;
pub const S_IEXEC: ::mode_t = 64;
pub const S_ENFMT: ::mode_t = 1024;
pub const S_IFMT: ::mode_t = 61440;
pub const S_IFDIR: ::mode_t = 16384;
pub const S_IFCHR: ::mode_t = 8192;
pub const S_IFBLK: ::mode_t = 24576;
pub const S_IFREG: ::mode_t = 32768;
pub const S_IFLNK: ::mode_t = 40960;
pub const S_IFSOCK: ::mode_t = 49152;
pub const S_IFIFO: ::mode_t = 4096;
pub const S_IRUSR: ::mode_t = 256;
pub const S_IWUSR: ::mode_t = 128;
pub const S_IXUSR: ::mode_t = 64;
pub const S_IRGRP: ::mode_t = 32;
pub const S_IWGRP: ::mode_t = 16;
pub const S_IXGRP: ::mode_t = 8;
pub const S_IROTH: ::mode_t = 4;
pub const S_IWOTH: ::mode_t = 2;
pub const S_IXOTH: ::mode_t = 1;
pub const S_IREAD: ::mode_t = 0o0400;
pub const S_IWRITE: ::mode_t = 0o0200;
pub const S_IEXEC: ::mode_t = 0o0100;
pub const S_ENFMT: ::mode_t = 0o2000;
pub const S_IFMT: ::mode_t = 0o17_0000;
pub const S_IFDIR: ::mode_t = 0o4_0000;
pub const S_IFCHR: ::mode_t = 0o2_0000;
pub const S_IFBLK: ::mode_t = 0o6_0000;
pub const S_IFREG: ::mode_t = 0o10_0000;
pub const S_IFLNK: ::mode_t = 0o12_0000;
pub const S_IFSOCK: ::mode_t = 0o14_0000;
pub const S_IFIFO: ::mode_t = 0o1_0000;
pub const S_IRUSR: ::mode_t = 0o0400;
pub const S_IWUSR: ::mode_t = 0o0200;
pub const S_IXUSR: ::mode_t = 0o0100;
pub const S_IRGRP: ::mode_t = 0o0040;
pub const S_IWGRP: ::mode_t = 0o0020;
pub const S_IXGRP: ::mode_t = 0o0010;
pub const S_IROTH: ::mode_t = 0o0004;
pub const S_IWOTH: ::mode_t = 0o0002;
pub const S_IXOTH: ::mode_t = 0o0001;

@@ -506,0 +506,0 @@ pub const SOL_TCP: ::c_int = 6;

@@ -142,3 +142,5 @@ // defined in architecture specific module

pub fn arc4random_buf(buf: *mut core::ffi::c_void, nbytes: ::size_t);
pub fn setgroups(ngroups: ::c_int, grouplist: *const ::gid_t) -> ::c_int;
}

@@ -554,3 +554,5 @@ use c_void;

pub fn pthread_set_name_np(thread: pthread_t, name: *const c_char) -> i32;
pub fn pthread_setname_np(thread: pthread_t, name: *const c_char) -> i32;
pub fn pthread_getname_np(thread: pthread_t, name: *mut c_char, len: usize) -> i32;
pub fn getrandom(buf: *mut c_void, buflen: usize, flags: u32) -> isize;
}

@@ -698,22 +698,22 @@ pub type c_char = i8;

// sys/stat.h
pub const S_IFMT: ::c_int = 0o0_170_000;
pub const S_IFDIR: ::c_int = 0o040_000;
pub const S_IFCHR: ::c_int = 0o020_000;
pub const S_IFBLK: ::c_int = 0o060_000;
pub const S_IFREG: ::c_int = 0o100_000;
pub const S_IFIFO: ::c_int = 0o010_000;
pub const S_IFLNK: ::c_int = 0o120_000;
pub const S_IFSOCK: ::c_int = 0o140_000;
pub const S_IRWXU: ::c_int = 0o0_700;
pub const S_IRUSR: ::c_int = 0o0_400;
pub const S_IWUSR: ::c_int = 0o0_200;
pub const S_IXUSR: ::c_int = 0o0_100;
pub const S_IRWXG: ::c_int = 0o0_070;
pub const S_IRGRP: ::c_int = 0o0_040;
pub const S_IWGRP: ::c_int = 0o0_020;
pub const S_IXGRP: ::c_int = 0o0_010;
pub const S_IRWXO: ::c_int = 0o0_007;
pub const S_IROTH: ::c_int = 0o0_004;
pub const S_IWOTH: ::c_int = 0o0_002;
pub const S_IXOTH: ::c_int = 0o0_001;
pub const S_IFMT: ::c_int = 0o17_0000;
pub const S_IFDIR: ::c_int = 0o4_0000;
pub const S_IFCHR: ::c_int = 0o2_0000;
pub const S_IFBLK: ::c_int = 0o6_0000;
pub const S_IFREG: ::c_int = 0o10_0000;
pub const S_IFIFO: ::c_int = 0o1_0000;
pub const S_IFLNK: ::c_int = 0o12_0000;
pub const S_IFSOCK: ::c_int = 0o14_0000;
pub const S_IRWXU: ::c_int = 0o0700;
pub const S_IRUSR: ::c_int = 0o0400;
pub const S_IWUSR: ::c_int = 0o0200;
pub const S_IXUSR: ::c_int = 0o0100;
pub const S_IRWXG: ::c_int = 0o0070;
pub const S_IRGRP: ::c_int = 0o0040;
pub const S_IWGRP: ::c_int = 0o0020;
pub const S_IXGRP: ::c_int = 0o0010;
pub const S_IRWXO: ::c_int = 0o0007;
pub const S_IROTH: ::c_int = 0o0004;
pub const S_IWOTH: ::c_int = 0o0002;
pub const S_IXOTH: ::c_int = 0o0001;

@@ -720,0 +720,0 @@ // stdlib.h

@@ -0,1 +1,12 @@

use exit_status;
use NET_MAC_AWARE;
use NET_MAC_AWARE_INHERIT;
use PRIV_AWARE_RESET;
use PRIV_DEBUG;
use PRIV_PFEXEC;
use PRIV_XPOLICY;
pub type lgrp_rsrc_t = ::c_int;
pub type lgrp_affinity_t = ::c_int;
s! {

@@ -24,2 +35,119 @@ pub struct shmid_ds {

s_no_extra_traits! {
#[cfg_attr(any(
target_arch = "x86", target_arch = "x86_64"),
repr(packed(4))
)]
pub struct epoll_event {
pub events: u32,
pub u64: u64,
}
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_exit: exit_status,
pub ut_tv: ::timeval,
pub ut_session: ::c_int,
pub ut_pad: [::c_int; _UTX_PADSIZE],
pub ut_syslen: ::c_short,
pub ut_host: [::c_char; _UTX_HOSTSIZE],
}
}
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_user == other.ut_user
&& 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_syslen == other.ut_syslen
&& self.ut_pad == other.ut_pad
&& 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_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_exit", &self.ut_exit)
.field("ut_tv", &self.ut_tv)
.field("ut_session", &self.ut_session)
.field("ut_pad", &self.ut_pad)
.field("ut_syslen", &self.ut_syslen)
.field("ut_host", &&self.ut_host[..])
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.ut_user.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_syslen.hash(state);
self.ut_pad.hash(state);
}
}
impl PartialEq for epoll_event {
fn eq(&self, other: &epoll_event) -> bool {
self.events == other.events
&& self.u64 == other.u64
}
}
impl Eq for epoll_event {}
impl ::fmt::Debug for epoll_event {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
let events = self.events;
let u64 = self.u64;
f.debug_struct("epoll_event")
.field("events", &events)
.field("u64", &u64)
.finish()
}
}
impl ::hash::Hash for epoll_event {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
let events = self.events;
let u64 = self.u64;
events.hash(state);
u64.hash(state);
}
}
}
}
pub const _UTX_USERSIZE: usize = 32;
pub const _UTX_LINESIZE: usize = 32;
pub const _UTX_PADSIZE: usize = 5;
pub const _UTX_IDSIZE: usize = 4;
pub const _UTX_HOSTSIZE: usize = 257;
pub const AF_LOCAL: ::c_int = 1; // AF_UNIX

@@ -49,4 +177,9 @@ pub const AF_FILE: ::c_int = 1; // AF_UNIX

pub const F_DUPFD_CLOEXEC: ::c_int = 37;
pub const F_DUPFD_CLOFORK: ::c_int = 58;
pub const F_DUP2FD_CLOEXEC: ::c_int = 36;
pub const F_DUP2FD_CLOFORK: ::c_int = 57;
pub const F_DUP3FD: ::c_int = 59;
pub const FD_CLOFORK: ::c_int = 2;
pub const FIL_ATTACH: ::c_int = 0x1;

@@ -70,2 +203,69 @@ pub const FIL_DETACH: ::c_int = 0x2;

pub const SIGINFO: ::c_int = 41;
pub const O_DIRECT: ::c_int = 0x2000000;
pub const O_CLOFORK: ::c_int = 0x4000000;
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x1000;
pub const MSG_CMSG_CLOFORK: ::c_int = 0x2000;
pub const PBIND_HARD: ::processorid_t = -3;
pub const PBIND_SOFT: ::processorid_t = -4;
pub const PS_SYSTEM: ::c_int = 1;
pub const MAP_FILE: ::c_int = 0;
pub const MAP_32BIT: ::c_int = 0x80;
pub const AF_NCA: ::c_int = 28;
pub const PF_NCA: ::c_int = AF_NCA;
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 _PC_LAST: ::c_int = 101;
pub const VSTATUS: usize = 16;
pub const VERASE2: usize = 17;
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 EPOLLRDHUP: ::c_int = 0x2000;
pub const EPOLLONESHOT: ::c_int = 0x40000000;
pub const EPOLLWAKEUP: ::c_int = 0x20000000;
pub const EPOLLEXCLUSIVE: ::c_int = 0x10000000;
pub const EPOLL_CLOEXEC: ::c_int = 0x80000;
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 PRIV_USER: ::c_uint = PRIV_DEBUG
| NET_MAC_AWARE
| NET_MAC_AWARE_INHERIT
| PRIV_XPOLICY
| PRIV_AWARE_RESET
| PRIV_PFEXEC;
pub const LGRP_RSRC_COUNT: ::lgrp_rsrc_t = 2;
pub const LGRP_RSRC_CPU: ::lgrp_rsrc_t = 0;
pub const LGRP_RSRC_MEM: ::lgrp_rsrc_t = 1;
pub const P_DISABLED: ::c_int = 0x008;
pub const AT_SUN_HWCAP2: ::c_uint = 2023;
pub const AT_SUN_FPTYPE: ::c_uint = 2027;
pub const B1000000: ::speed_t = 24;

@@ -86,2 +286,20 @@ pub const B1152000: ::speed_t = 25;

pub fn epoll_pwait(
epfd: ::c_int,
events: *mut ::epoll_event,
maxevents: ::c_int,
timeout: ::c_int,
sigmask: *const ::sigset_t,
) -> ::c_int;
pub fn epoll_create(size: ::c_int) -> ::c_int;
pub fn epoll_create1(flags: ::c_int) -> ::c_int;
pub fn epoll_wait(
epfd: ::c_int,
events: *mut ::epoll_event,
maxevents: ::c_int,
timeout: ::c_int,
) -> ::c_int;
pub fn epoll_ctl(epfd: ::c_int, op: ::c_int, fd: ::c_int, event: *mut ::epoll_event)
-> ::c_int;
pub fn mincore(addr: ::caddr_t, len: ::size_t, vec: *mut ::c_char) -> ::c_int;

@@ -119,2 +337,12 @@

pub fn ptsname_r(fildes: ::c_int, name: *mut ::c_char, namelen: ::size_t) -> ::c_int;
pub fn syncfs(fd: ::c_int) -> ::c_int;
pub fn strcasecmp_l(s1: *const ::c_char, s2: *const ::c_char, loc: ::locale_t) -> ::c_int;
pub fn strncasecmp_l(
s1: *const ::c_char,
s2: *const ::c_char,
n: ::size_t,
loc: ::locale_t,
) -> ::c_int;
}

@@ -0,4 +1,22 @@

use exit_status;
use NET_MAC_AWARE;
use NET_MAC_AWARE_INHERIT;
use PRIV_AWARE_RESET;
use PRIV_DEBUG;
use PRIV_PFEXEC;
use PRIV_XPOLICY;
pub type door_attr_t = ::c_uint;
pub type door_id_t = ::c_ulonglong;
pub type lgrp_affinity_t = ::c_uint;
e! {
#[repr(u32)]
pub enum lgrp_rsrc_t {
LGRP_RSRC_CPU = 0,
LGRP_RSRC_MEM = 1,
LGRP_RSRC_TYPES = 2,
}
}
s! {

@@ -23,2 +41,11 @@ pub struct shmid_ds {

pub struct xrs_t {
pub xrs_id: ::c_ulong,
pub xrs_ptr: *mut ::c_char,
}
}
s_no_extra_traits! {
#[repr(packed)]
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_desc_t__d_data__d_desc {

@@ -28,5 +55,3 @@ pub d_descriptor: ::c_int,

}
}
s_no_extra_traits! {
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]

@@ -53,9 +78,88 @@ pub union door_desc_t__d_data {

}
pub struct utmpx {
pub ut_user: [::c_char; _UTMP_USER_LEN],
pub ut_id: [::c_char; _UTMP_ID_LEN],
pub ut_line: [::c_char; _UTMP_LINE_LEN],
pub ut_pid: ::pid_t,
pub ut_type: ::c_short,
pub ut_exit: exit_status,
pub ut_tv: ::timeval,
pub ut_session: ::c_int,
pub pad: [::c_int; 5],
pub ut_syslen: ::c_short,
pub ut_host: [::c_char; 257],
}
}
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_user == other.ut_user
&& 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_syslen == other.ut_syslen
&& self.pad == other.pad
&& 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_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_exit", &self.ut_exit)
.field("ut_tv", &self.ut_tv)
.field("ut_session", &self.ut_session)
.field("pad", &self.pad)
.field("ut_syslen", &self.ut_syslen)
.field("ut_host", &&self.ut_host[..])
.finish()
}
}
impl ::hash::Hash for utmpx {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
self.ut_user.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_syslen.hash(state);
self.pad.hash(state);
}
}
}
}
pub const _UTMP_USER_LEN: usize = 32;
pub const _UTMP_LINE_LEN: usize = 32;
pub const _UTMP_ID_LEN: usize = 4;
pub const PORT_SOURCE_POSTWAIT: ::c_int = 8;
pub const PORT_SOURCE_SIGNAL: ::c_int = 9;
pub const AF_LOCAL: ::c_int = 0;
pub const AF_FILE: ::c_int = 0;
pub const AF_LOCAL: ::c_int = 1; // AF_UNIX
pub const AF_FILE: ::c_int = 1; // AF_UNIX

@@ -71,2 +175,24 @@ pub const TCP_KEEPIDLE: ::c_int = 0x1d;

pub const _PC_LAST: ::c_int = 102;
pub const PRIV_PROC_SENSITIVE: ::c_uint = 0x0008;
pub const PRIV_PFEXEC_AUTH: ::c_uint = 0x0200;
pub const PRIV_PROC_TPD: ::c_uint = 0x0400;
pub const PRIV_TPD_UNSAFE: ::c_uint = 0x0800;
pub const PRIV_PROC_TPD_RESET: ::c_uint = 0x1000;
pub const PRIV_TPD_KILLABLE: ::c_uint = 0x2000;
pub const PRIV_USER: ::c_uint = PRIV_DEBUG
| PRIV_PROC_SENSITIVE
| NET_MAC_AWARE
| NET_MAC_AWARE_INHERIT
| PRIV_XPOLICY
| PRIV_AWARE_RESET
| PRIV_PFEXEC
| PRIV_PFEXEC_AUTH
| PRIV_PROC_TPD
| PRIV_TPD_UNSAFE
| PRIV_TPD_KILLABLE
| PRIV_PROC_TPD_RESET;
extern "C" {

@@ -79,20 +205,20 @@ pub fn fexecve(

pub fn mincore(addr: *const ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn mincore(addr: *mut ::c_void, len: ::size_t, vec: *mut ::c_char) -> ::c_int;
pub fn door_call(d: ::c_int, params: *const door_arg_t) -> ::c_int;
pub fn door_call(d: ::c_int, params: *mut door_arg_t) -> ::c_int;
pub fn door_return(
data_ptr: *const ::c_char,
data_ptr: *mut ::c_char,
data_size: ::size_t,
desc_ptr: *const door_desc_t,
desc_ptr: *mut door_desc_t,
num_desc: ::c_uint,
);
) -> ::c_int;
pub fn door_create(
server_procedure: extern "C" fn(
cookie: *const ::c_void,
argp: *const ::c_char,
cookie: *mut ::c_void,
argp: *mut ::c_char,
arg_size: ::size_t,
dp: *const door_desc_t,
dp: *mut door_desc_t,
n_desc: ::c_uint,
),
cookie: *const ::c_void,
cookie: *mut ::c_void,
attributes: door_attr_t,

@@ -99,0 +225,0 @@ ) -> ::c_int;

@@ -0,1 +1,7 @@

cfg_if! {
if #[cfg(target_os = "solaris")] {
use unix::solarish::solaris;
}
}
pub type greg_t = ::c_long;

@@ -49,2 +55,6 @@

pub dlpi_subs: ::c_ulonglong,
#[cfg(target_os = "solaris")]
pub dlpi_tls_modid: ::c_ulong,
#[cfg(target_os = "solaris")]
pub dlpi_tls_data: *mut ::c_void,
}

@@ -75,3 +85,14 @@ }

pub uc_mcontext: mcontext_t,
pub uc_filler: [::c_long; 5],
#[cfg(target_os = "illumos")]
pub uc_brand_data: [*mut ::c_void; 3],
#[cfg(target_os = "illumos")]
pub uc_xsave: ::c_long,
#[cfg(target_os = "illumos")]
pub uc_filler: ::c_long,
#[cfg(target_os = "solaris")]
pub uc_xrs: solaris::xrs_t,
#[cfg(target_os = "solaris")]
pub uc_lwpid: ::c_uint,
#[cfg(target_os = "solaris")]
pub uc_filler: [::c_long; 2],
}

@@ -78,0 +99,0 @@ }

@@ -29,38 +29,42 @@ // AT_SUN_HWCAP

pub const AV_386_AVX: u32 = 0x20000000;
pub const AV_386_VMX: u32 = 0x40000000;
pub const AV_386_AMD_SVM: u32 = 0x80000000;
// AT_SUN_HWCAP2
pub const AV_386_2_F16C: u32 = 0x00000001;
pub const AV_386_2_RDRAND: u32 = 0x00000002;
pub const AV_386_2_BMI1: u32 = 0x00000004;
pub const AV_386_2_BMI2: u32 = 0x00000008;
pub const AV_386_2_FMA: u32 = 0x00000010;
pub const AV_386_2_AVX2: u32 = 0x00000020;
pub const AV_386_2_ADX: u32 = 0x00000040;
pub const AV_386_2_RDSEED: u32 = 0x00000080;
pub const AV_386_2_AVX512F: u32 = 0x00000100;
pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
pub const AV_386_2_AVX512PF: u32 = 0x00000800;
pub const AV_386_2_AVX512ER: u32 = 0x00001000;
pub const AV_386_2_AVX512CD: u32 = 0x00002000;
pub const AV_386_2_AVX512BW: u32 = 0x00004000;
pub const AV_386_2_AVX512VL: u32 = 0x00008000;
pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
pub const AV_386_2_SHA: u32 = 0x00100000;
pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
pub const AV_386_2_CLWB: u32 = 0x00800000;
pub const AV_386_2_MONITORX: u32 = 0x01000000;
pub const AV_386_2_CLZERO: u32 = 0x02000000;
pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
pub const AV_386_2_VAES: u32 = 0x10000000;
// AT_SUN_FPTYPE
pub const AT_386_FPINFO_NONE: u32 = 0;
pub const AT_386_FPINFO_FXSAVE: u32 = 1;
pub const AT_386_FPINFO_XSAVE: u32 = 2;
pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;
cfg_if! {
if #[cfg(target_os = "illumos")] {
pub const AV_386_VMX: u32 = 0x40000000;
pub const AV_386_AMD_SVM: u32 = 0x80000000;
// AT_SUN_HWCAP2
pub const AV_386_2_F16C: u32 = 0x00000001;
pub const AV_386_2_RDRAND: u32 = 0x00000002;
pub const AV_386_2_BMI1: u32 = 0x00000004;
pub const AV_386_2_BMI2: u32 = 0x00000008;
pub const AV_386_2_FMA: u32 = 0x00000010;
pub const AV_386_2_AVX2: u32 = 0x00000020;
pub const AV_386_2_ADX: u32 = 0x00000040;
pub const AV_386_2_RDSEED: u32 = 0x00000080;
pub const AV_386_2_AVX512F: u32 = 0x00000100;
pub const AV_386_2_AVX512DQ: u32 = 0x00000200;
pub const AV_386_2_AVX512IFMA: u32 = 0x00000400;
pub const AV_386_2_AVX512PF: u32 = 0x00000800;
pub const AV_386_2_AVX512ER: u32 = 0x00001000;
pub const AV_386_2_AVX512CD: u32 = 0x00002000;
pub const AV_386_2_AVX512BW: u32 = 0x00004000;
pub const AV_386_2_AVX512VL: u32 = 0x00008000;
pub const AV_386_2_AVX512VBMI: u32 = 0x00010000;
pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000;
pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000;
pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000;
pub const AV_386_2_SHA: u32 = 0x00100000;
pub const AV_386_2_FSGSBASE: u32 = 0x00200000;
pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000;
pub const AV_386_2_CLWB: u32 = 0x00800000;
pub const AV_386_2_MONITORX: u32 = 0x01000000;
pub const AV_386_2_CLZERO: u32 = 0x02000000;
pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000;
pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000;
pub const AV_386_2_VAES: u32 = 0x10000000;
// AT_SUN_FPTYPE
pub const AT_386_FPINFO_NONE: u32 = 0;
pub const AT_386_FPINFO_FXSAVE: u32 = 1;
pub const AT_386_FPINFO_XSAVE: u32 = 2;
pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3;
}
}

@@ -249,24 +249,24 @@ use super::{Send, Sync};

pub const S_IFIFO: mode_t = 0o1_0000;
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_IFCHR: mode_t = 0o2_0000;
pub const S_IFBLK: mode_t = 0o6_0000;
pub const S_IFDIR: mode_t = 0o4_0000;
pub const S_IFREG: mode_t = 0o10_0000;
pub const S_IFLNK: mode_t = 0o12_0000;
pub const S_IFSOCK: mode_t = 0o14_0000;
pub const S_IFMT: mode_t = 0o17_0000;
pub const S_IRWXO: mode_t = 0x7;
pub const S_IXOTH: mode_t = 0x1;
pub const S_IWOTH: mode_t = 0x2;
pub const S_IROTH: mode_t = 0x4;
pub const S_IRWXG: mode_t = 0x38;
pub const S_IXGRP: mode_t = 0x8;
pub const S_IWGRP: mode_t = 0x10;
pub const S_IRGRP: mode_t = 0x20;
pub const S_IRWXU: mode_t = 0x1c0;
pub const S_IXUSR: mode_t = 0x40;
pub const S_IWUSR: mode_t = 0x80;
pub const S_IRUSR: mode_t = 0x100;
pub const S_ISVTX: mode_t = 0x200;
pub const S_ISGID: mode_t = 0x400;
pub const S_ISUID: mode_t = 0x800;
pub const S_IRWXO: mode_t = 0o0007;
pub const S_IXOTH: mode_t = 0o0001;
pub const S_IWOTH: mode_t = 0o0002;
pub const S_IROTH: mode_t = 0o0004;
pub const S_IRWXG: mode_t = 0o0070;
pub const S_IXGRP: mode_t = 0o0010;
pub const S_IWGRP: mode_t = 0o0020;
pub const S_IRGRP: mode_t = 0o0040;
pub const S_IRWXU: mode_t = 0o0700;
pub const S_IXUSR: mode_t = 0o0100;
pub const S_IWUSR: mode_t = 0o0200;
pub const S_IRUSR: mode_t = 0o0400;
pub const S_ISVTX: mode_t = 0o1000;
pub const S_ISGID: mode_t = 0o2000;
pub const S_ISUID: mode_t = 0o4000;
pub const DT_UNKNOWN: u8 = 0;

@@ -273,0 +273,0 @@ pub const DT_BLK: u8 = 1;

@@ -65,2 +65,7 @@ pub type sa_family_t = ::c_ushort;

}
pub struct linger {
pub l_onoff: ::c_int,
pub l_linger: ::c_int,
}
}

@@ -76,5 +81,12 @@

pub const SO_REUSEADDR: ::c_int = 2;
pub const SO_TYPE: ::c_int = 3;
pub const SO_ERROR: ::c_int = 4;
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_LINGER: ::c_int = 13;
pub const SO_ACCEPTCONN: ::c_int = 30;
pub const SO_PROTOCOL: ::c_int = 38;
pub const SO_DOMAIN: ::c_int = 39;
pub const SO_RCVTIMEO: ::c_int = 66;

@@ -85,5 +97,7 @@ pub const SO_SNDTIMEO: ::c_int = 67;

pub const SOCK_STREAM: ::c_int = 6;
pub const SOCK_NONBLOCK: ::c_int = 0x00004000;
pub const SOL_SOCKET: ::c_int = 0x7fffffff;
pub const AF_UNSPEC: ::c_int = 0;
pub const AF_INET: ::c_int = 1;

@@ -94,2 +108,3 @@ pub const AF_INET6: ::c_int = 2;

pub const IPPROTO_TCP: ::c_int = 6;
pub const IPPROTO_UDP: ::c_int = 17;
pub const IPPROTO_IPV6: ::c_int = 41;

@@ -103,2 +118,3 @@

pub const IPV6_UNICAST_HOPS: ::c_int = 16;
pub const IPV6_MULTICAST_LOOP: ::c_int = 19;

@@ -113,2 +129,5 @@ pub const IPV6_JOIN_GROUP: ::c_int = 20;

pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_KEEPIDLE: ::c_int = 4;
pub const TCP_KEEPINTVL: ::c_int = 5;
pub const TCP_KEEPCNT: ::c_int = 6;

@@ -123,2 +142,8 @@ pub const EAI_SYSTEM: ::c_int = -11;

pub fn accept(socket: ::c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> ::c_int;
pub fn accept4(
socket: ::c_int,
addr: *mut sockaddr,
addrlen: *mut socklen_t,
flags: ::c_int,
) -> ::c_int;

@@ -125,0 +150,0 @@ pub fn getsockname(socket: ::c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> ::c_int;

@@ -143,9 +143,9 @@ //! Windows CRT definitions

pub const S_IFCHR: ::c_int = 8192;
pub const S_IFDIR: ::c_int = 16384;
pub const S_IFREG: ::c_int = 32768;
pub const S_IFMT: ::c_int = 61440;
pub const S_IEXEC: ::c_int = 64;
pub const S_IWRITE: ::c_int = 128;
pub const S_IREAD: ::c_int = 256;
pub const S_IFCHR: ::c_int = 0o2_0000;
pub const S_IFDIR: ::c_int = 0o4_0000;
pub const S_IFREG: ::c_int = 0o10_0000;
pub const S_IFMT: ::c_int = 0o17_0000;
pub const S_IEXEC: ::c_int = 0o0100;
pub const S_IWRITE: ::c_int = 0o0200;
pub const S_IREAD: ::c_int = 0o0400;

@@ -152,0 +152,0 @@ pub const LC_ALL: ::c_int = 0;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display