Update nix crate from 0.23 to 0.25

Summary:
When I was trying to use `nix::unistd::gethostname` in D39783468, the version `0.23.0` will require users to pass in a `buf` as a parameter, however, in `0.25.0`, there is no need to pass in a `buf` as a parameter. Hence, I would love to update `nix` crate from `0.23` to `0.25` in order to not pass a redundant `buf` while calling `nix::unistd::gethostname`.

I fixed conflicts reflected from the signals manually so this diff is more than a few lines of code in `Cargo.toml`.

Here are the [changes](https://github.com/nix-rust/nix/compare/v0.23.0..v0.25.0) between `0.23` and `0.25`. See `CHANGELOG.md` for the most significant changes in this version.

Reviewed By: bgw

Differential Revision: D39919100

fbshipit-source-id: 7f62585ff72230bd2608aeb5a4780dc0128795f7
This commit is contained in:
Sophia Sun 2022-10-03 15:31:17 -07:00 committed by Facebook GitHub Bot
parent be457c2dc3
commit aadb1865e7
9 changed files with 17 additions and 10 deletions

View file

@ -51,7 +51,7 @@ path = "strace_minimal.rs"
[dependencies]
anyhow = "1.0.65"
clap = { version = "3.2.17", features = ["derive", "regex", "unicode", "wrap_help"] }
nix = "0.23"
nix = "0.25"
reverie = { version = "0.1.0", path = "../reverie" }
reverie-ptrace = { version = "0.1.0", path = "../reverie-ptrace" }
reverie-util = { version = "0.1.0", path = "../reverie-util" }

View file

@ -13,7 +13,7 @@ bitflags = "1.3"
colored = "1.9"
futures = { version = "0.3.22", features = ["async-await", "compat"] }
libc = "0.2.132"
nix = "0.23"
nix = "0.25"
serde = { version = "1.0.136", features = ["derive", "rc"] }
syscalls = { version = "0.6.6", features = ["serde"] }
thiserror = "1.0.36"

View file

@ -16,7 +16,7 @@ futures = { version = "0.3.22", features = ["async-await", "compat"] }
goblin = "0.5.2"
lazy_static = "1.4"
libc = "0.2.132"
nix = "0.23"
nix = "0.25"
num-traits = "0.2"
paste = "1.0"
perf-event-open-sys = "1.0"

View file

@ -7,8 +7,9 @@
* LICENSE file in the root directory of this source tree.
*/
use std::io::IoSlice;
use nix::sys::uio;
use nix::sys::uio::IoVec;
use nix::sys::uio::RemoteIoVec;
use nix::unistd::Pid;
@ -45,7 +46,7 @@ pub fn populate_mmap_page(pid: Pid, page_address: u64) -> nix::Result<()> {
#[cfg(target_arch = "aarch64")]
const SOFTWARE_INTERUPT: u8 = 0x00; // For aarch64, we should use BRK 1 but as it is not a single-byte instruction, we'll use a sequence of 0x00 (same as a sequence of udf #0x0 instructions)
syscall_stubs.resize_with(TRAMPOLINE_SIZE, || SOFTWARE_INTERUPT);
let local_iov = &[IoVec::from_slice(syscall_stubs.as_slice())];
let local_iov = &[IoSlice::new(syscall_stubs.as_slice())];
let remote_iov = &[RemoteIoVec {
base: page_address as usize,
len: TRAMPOLINE_SIZE,

View file

@ -11,7 +11,7 @@ license = "BSD-2-Clause"
bitflags = "1.3"
derive_more = "0.99.17"
libc = "0.2.132"
nix = "0.23"
nix = "0.25"
paste = "1.0"
serde = { version = "1.0.136", features = ["derive", "rc"] }
syscalls = { version = "0.6.6", features = ["serde"] }

View file

@ -8,11 +8,12 @@ edition = "2021"
license = "BSD-2-Clause"
[dependencies]
anyhow = "1.0.65"
bitvec = { version = "0.17", features = ["serde"] }
chrono = { version = "0.4", features = ["clock", "serde", "std"], default-features = false }
clap = { version = "3.2.17", features = ["derive", "regex", "unicode", "wrap_help"] }
libc = "0.2.132"
nix = "0.23"
nix = "0.25"
reverie = { version = "0.1.0", path = "../reverie" }
serde = { version = "1.0.136", features = ["derive", "rc"] }
tracing = "0.1.35"

View file

@ -18,7 +18,7 @@ lazy_static = "1.4"
libc = "0.2.132"
linked-hash-map = { version = "0.5", features = ["serde_impl"] }
memmap = "0.7"
nix = "0.23"
nix = "0.25"
object = { version = "0.28", features = ["write"] }
procfs = "0.9"
raw-cpuid = "10.6.0"

View file

@ -12,7 +12,7 @@ bitflags = "1.3"
futures = { version = "0.3.22", features = ["async-await", "compat"] }
lazy_static = "1.4"
libc = "0.2.132"
nix = "0.23"
nix = "0.25"
parking_lot = { version = "0.11.2", features = ["send_guard"] }
reverie-process = { version = "0.1.0", path = "../reverie-process" }
reverie-syscalls = { version = "0.1.0", path = "../reverie-syscalls" }

View file

@ -175,7 +175,12 @@ mod tests {
#[test]
fn stack_allocator_should_work() {
check_fn::<LocalState, _>(|| {
assert_ne!(nix::sys::utsname::uname().sysname(), "");
assert_ne!(
nix::sys::utsname::uname()
.expect("Failed getting uname.")
.sysname(),
""
);
unsafe { libc::syscall(libc::SYS_exit_group, 0) };
});
}