Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

rustix

Package Overview
Dependencies
Maintainers
1
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rustix - npm Package Compare versions

Comparing version
1.0.7
to
1.0.8
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "6883580f41f6055fced177f741a31b91a7e60fb4"
"sha1": "5b104ec6c0fd8855b341d6a2c8edf72843ad6cee"
},
"path_in_vcs": ""
}
+163
-90

@@ -7,5 +7,5 @@ # This file is automatically @generated by Cargo.

name = "adler2"
version = "2.0.0"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"

@@ -40,5 +40,5 @@ [[package]]

name = "autocfg"
version = "1.4.0"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"

@@ -53,5 +53,5 @@ [[package]]

name = "bitflags"
version = "2.9.0"
version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967"
dependencies = [

@@ -64,5 +64,5 @@ "compiler_builtins",

name = "bumpalo"
version = "3.17.0"
version = "3.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee"

@@ -77,5 +77,5 @@ [[package]]

name = "cfg-if"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"

@@ -132,8 +132,5 @@ [[package]]

name = "compiler_builtins"
version = "0.1.156"
version = "0.1.160"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ffbd2789fe5bb95b96a2e22cbe3128239dc46ff0374e0d38e9f102062d7055"
dependencies = [
"rustc-std-workspace-core",
]
checksum = "6376049cfa92c0aa8b9ac95fae22184b981c658208d4ed8a1dc553cd83612895"

@@ -218,8 +215,8 @@ [[package]]

name = "dashmap"
version = "5.4.0"
version = "5.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856"
dependencies = [
"cfg-if",
"hashbrown",
"hashbrown 0.14.5",
"lock_api",

@@ -238,8 +235,8 @@ "once_cell",

name = "errno"
version = "0.3.11"
version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [
"libc",
"windows-sys",
"windows-sys 0.60.2",
]

@@ -255,5 +252,5 @@

name = "flate2"
version = "1.0.35"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
dependencies = [

@@ -343,5 +340,5 @@ "crc32fast",

name = "getrandom"
version = "0.3.2"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
dependencies = [

@@ -356,6 +353,7 @@ "cfg-if",

name = "half"
version = "2.2.1"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0"
checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9"
dependencies = [
"cfg-if",
"crunchy",

@@ -371,2 +369,8 @@ ]

[[package]]
name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hermit-abi"

@@ -387,3 +391,3 @@ version = "0.1.19"

"autocfg",
"hashbrown",
"hashbrown 0.12.3",
]

@@ -424,5 +428,5 @@

name = "libc"
version = "0.2.172"
version = "0.2.174"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"

@@ -441,5 +445,5 @@ [[package]]

name = "lock_api"
version = "0.4.12"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765"
dependencies = [

@@ -458,5 +462,5 @@ "autocfg",

name = "memchr"
version = "2.7.4"
version = "2.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"

@@ -474,5 +478,5 @@ [[package]]

name = "miniz_oxide"
version = "0.8.8"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [

@@ -493,5 +497,5 @@ "adler2",

name = "once_cell"
version = "1.20.3"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"

@@ -512,5 +516,5 @@ [[package]]

name = "parking_lot"
version = "0.12.3"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13"
dependencies = [

@@ -523,5 +527,5 @@ "lock_api",

name = "parking_lot_core"
version = "0.9.10"
version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5"
dependencies = [

@@ -532,3 +536,3 @@ "cfg-if",

"smallvec",
"windows-targets",
"windows-targets 0.52.6",
]

@@ -596,5 +600,5 @@

name = "r-efi"
version = "5.2.0"
version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"

@@ -623,7 +627,7 @@ [[package]]

name = "redox_syscall"
version = "0.5.11"
version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6"
dependencies = [
"bitflags 2.9.0",
"bitflags 2.9.1",
]

@@ -633,5 +637,5 @@

name = "regex"
version = "1.9.0"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [

@@ -646,5 +650,5 @@ "aho-corasick",

name = "regex-automata"
version = "0.3.9"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9"
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [

@@ -658,5 +662,5 @@ "aho-corasick",

name = "regex-syntax"
version = "0.7.5"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"

@@ -677,11 +681,11 @@ [[package]]

name = "rustix"
version = "1.0.6"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91b73dab8b4bf63c9dbf81b3d2d4ae6e54033e397c3051a3baac27f7e4e5607e"
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
dependencies = [
"bitflags 2.9.0",
"bitflags 2.9.1",
"errno",
"libc",
"linux-raw-sys",
"windows-sys",
"windows-sys 0.59.0",
]

@@ -691,6 +695,5 @@

name = "rustix"
version = "1.0.7"
version = "1.0.8"
dependencies = [
"bitflags 2.9.0",
"compiler_builtins",
"bitflags 2.9.1",
"criterion",

@@ -708,3 +711,3 @@ "errno",

"tempfile",
"windows-sys",
"windows-sys 0.59.0",
]

@@ -714,5 +717,5 @@

name = "rustversion"
version = "1.0.20"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"

@@ -799,14 +802,11 @@ [[package]]

name = "slab"
version = "0.4.9"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
dependencies = [
"autocfg",
]
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
[[package]]
name = "smallvec"
version = "1.15.0"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"

@@ -821,5 +821,5 @@ [[package]]

name = "syn"
version = "2.0.101"
version = "2.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8"
dependencies = [

@@ -833,5 +833,5 @@ "proc-macro2",

name = "tempfile"
version = "3.19.1"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [

@@ -841,4 +841,4 @@ "fastrand",

"once_cell",
"rustix 1.0.6",
"windows-sys",
"rustix 1.0.7",
"windows-sys 0.59.0",
]

@@ -848,5 +848,5 @@

name = "textwrap"
version = "0.16.1"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057"

@@ -978,3 +978,3 @@ [[package]]

dependencies = [
"windows-sys",
"windows-sys 0.59.0",
]

@@ -994,6 +994,15 @@

dependencies = [
"windows-targets",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets 0.53.2",
]
[[package]]
name = "windows-targets"

@@ -1004,13 +1013,29 @@ version = "0.52.6"

dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.53.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef"
dependencies = [
"windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0",
"windows_i686_gnullvm 0.53.0",
"windows_i686_msvc 0.53.0",
"windows_x86_64_gnu 0.53.0",
"windows_x86_64_gnullvm 0.53.0",
"windows_x86_64_msvc 0.53.0",
]
[[package]]
name = "windows_aarch64_gnullvm"

@@ -1022,2 +1047,8 @@ version = "0.52.6"

[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
[[package]]
name = "windows_aarch64_msvc"

@@ -1029,2 +1060,8 @@ version = "0.52.6"

[[package]]
name = "windows_aarch64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
[[package]]
name = "windows_i686_gnu"

@@ -1036,2 +1073,8 @@ version = "0.52.6"

[[package]]
name = "windows_i686_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
[[package]]
name = "windows_i686_gnullvm"

@@ -1043,2 +1086,8 @@ version = "0.52.6"

[[package]]
name = "windows_i686_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
[[package]]
name = "windows_i686_msvc"

@@ -1050,2 +1099,8 @@ version = "0.52.6"

[[package]]
name = "windows_i686_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
[[package]]
name = "windows_x86_64_gnu"

@@ -1057,2 +1112,8 @@ version = "0.52.6"

[[package]]
name = "windows_x86_64_gnu"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
[[package]]
name = "windows_x86_64_gnullvm"

@@ -1064,2 +1125,8 @@ version = "0.52.6"

[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
[[package]]
name = "windows_x86_64_msvc"

@@ -1071,2 +1138,8 @@ version = "0.52.6"

[[package]]
name = "windows_x86_64_msvc"
version = "0.53.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
[[package]]
name = "wit-bindgen-rt"

@@ -1077,3 +1150,3 @@ version = "0.39.0"

dependencies = [
"bitflags 2.9.0",
"bitflags 2.9.1",
]

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

name = "rustix"
version = "1.0.7"
version = "1.0.8"
authors = [

@@ -127,6 +127,4 @@ "Dan Gohman <dev@sunfishcode.online>",

"rustc-std-workspace-alloc",
"compiler_builtins",
"linux-raw-sys/rustc-dep-of-std",
"bitflags/rustc-dep-of-std",
"compiler_builtins?/rustc-dep-of-std",
]

@@ -166,6 +164,2 @@ shm = ["fs"]

[dependencies.compiler_builtins]
version = "0.1.49"
optional = true
[dependencies.core]

@@ -252,3 +246,3 @@ version = "1.0.0"

[target."cfg(windows)".dependencies.windows-sys]
version = ">=0.52, <0.60"
version = ">=0.52, <0.61"
features = [

@@ -255,0 +249,0 @@ "Win32_Foundation",

@@ -81,4 +81,2 @@ //! libc syscalls supporting `rustix::net::sockopt`.

use linux_raw_sys::xdp::{xdp_mmap_offsets, xdp_statistics, xdp_statistics_v1};
#[cfg(windows)]
use windows_sys::Win32::Foundation::BOOL;

@@ -1310,6 +1308,7 @@ #[inline]

// `getsockopt` and `setsockopt` represent boolean values as integers.
#[cfg(not(windows))]
//
// On Windows, this should use `BOOL`, however windows-sys moved its `BOOL`
// from `windows_sys::Win32::Foundation::BOOL` to `windows_sys::core::BOOL`
// in windows-sys 0.60, and we'd prefer
type RawSocketBool = c::c_int;
#[cfg(windows)]
type RawSocketBool = BOOL;

@@ -1316,0 +1315,0 @@ // Wrap `RawSocketBool` in a newtype to discourage misuse.

@@ -346,4 +346,4 @@ //! libc syscalls supporting `rustix::thread`.

#[inline]
pub(crate) fn unshare(flags: crate::thread::UnshareFlags) -> io::Result<()> {
unsafe { ret(c::unshare(flags.bits() as i32)) }
pub(crate) unsafe fn unshare(flags: crate::thread::UnshareFlags) -> io::Result<()> {
ret(c::unshare(flags.bits() as i32))
}

@@ -350,0 +350,0 @@

@@ -25,4 +25,3 @@ //! Linux auxv support.

use linux_raw_sys::general::{
AT_BASE, AT_CLKTCK, AT_EXECFN, AT_HWCAP, AT_HWCAP2, AT_MINSIGSTKSZ, AT_NULL, AT_PAGESZ,
AT_SYSINFO_EHDR,
AT_CLKTCK, AT_EXECFN, AT_HWCAP, AT_HWCAP2, AT_MINSIGSTKSZ, AT_NULL, AT_PAGESZ, AT_SYSINFO_EHDR,
};

@@ -405,9 +404,8 @@ #[cfg(feature = "runtime")]

AT_EXECFN => execfn = check_raw_pointer::<c::c_char>(a_val as *mut _)?.as_ptr(),
AT_SYSINFO_EHDR => sysinfo_ehdr = check_elf_base(a_val as *mut _)?.as_ptr(),
AT_BASE => {
// The `AT_BASE` value can be null in a static executable that
// doesn't use a dynamic linker. If so, ignore it.
if !a_val.is_null() {
let _ = check_elf_base(a_val.cast())?;
// Use the `AT_SYSINFO_EHDR` if it matches the platform rustix is
// compiled for.
AT_SYSINFO_EHDR => {
if let Some(value) = check_elf_base(a_val as *mut _) {
sysinfo_ehdr = value.as_ptr();
}

@@ -453,4 +451,3 @@ }

// The base and sysinfo_ehdr (if present) matches our platform. Accept the
// aux values.
// Accept the aux values.
PAGE_SIZE.store(pagesz, Relaxed);

@@ -457,0 +454,0 @@ CLOCK_TICKS_PER_SECOND.store(clktck, Relaxed);

@@ -375,4 +375,4 @@ //! linux_raw syscalls supporting `rustix::thread`.

#[inline]
pub(crate) fn unshare(flags: crate::thread::UnshareFlags) -> io::Result<()> {
unsafe { ret(syscall_readonly!(__NR_unshare, flags)) }
pub(crate) unsafe fn unshare(flags: crate::thread::UnshareFlags) -> io::Result<()> {
ret(syscall_readonly!(__NR_unshare, flags))
}

@@ -379,0 +379,0 @@

@@ -5,3 +5,3 @@ //! Linux `futex`.

//! such as mutexes, rwlocks, and condvars. For a higher-level API that
//! provides those abstractions, see [rustix-futex-syntax].
//! provides those abstractions, see [rustix-futex-sync].
//!

@@ -8,0 +8,0 @@ //! # Examples

@@ -0,1 +1,8 @@

//! Thread-specific namespace functions.
//!
//! # Safety
//!
//! The `unshare` function can cause threads to use different file descriptor tables.
#![allow(unsafe_code)]
use bitflags::bitflags;

@@ -130,5 +137,21 @@ use linux_raw_sys::general::{

/// `unshare(flags)`—Deprecated in favor of [`unshare_unsafe`].
///
/// This function should be unsafe; see the safety comment on `unshare_unsafe`.
#[deprecated(since = "1.1.0", note = "Use `unshare_unsafe`")]
pub fn unshare(flags: UnshareFlags) -> io::Result<()> {
// SAFETY: This is not actually safe. This function is deprecated and users
// should use `unshare_unsafe` instead.
unsafe { syscalls::unshare(flags) }
}
/// `unshare(flags)`—Disassociate parts of the current thread's execution
/// context with other threads.
///
/// # Safety
///
/// When using `UnshareFlags::FILES`, this function can cause one thread to be
/// unable to use file descriptors created on a different thread. Callers must
/// ensure that threads never observe file descriptors from unshared tables.
///
/// # References

@@ -138,4 +161,4 @@ /// - [Linux]

/// [Linux]: https://man7.org/linux/man-pages/man2/unshare.2.html
pub fn unshare(flags: UnshareFlags) -> io::Result<()> {
pub unsafe fn unshare_unsafe(flags: UnshareFlags) -> io::Result<()> {
syscalls::unshare(flags)
}

Sorry, the diff of this file is not supported yet