Skip to content

Commit df60c99

Browse files
committed
upgrade to libuv v1.44.2
1 parent 0843969 commit df60c99

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libuv"
3-
version = "2.4.0"
3+
version = "2.5.0"
44
description = "A safe rust wrapper for libuv"
55
homepage = "https://github.com/bmatcuk/libuv-rs"
66
repository = "https://github.com/bmatcuk/libuv-rs"
@@ -20,7 +20,7 @@ maintenance = { status = "actively-developed" }
2020

2121
[dependencies]
2222
bitflags = "~1.2.1"
23-
libuv-sys2 = "~1.43.0"
23+
libuv-sys2 = "~1.44.2"
2424

2525
[dev-dependencies]
2626
rand = "~0.7.3"

src/handles/process.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,21 @@ extern "C" fn uv_exit_cb(
3737
bitflags! {
3838
/// Flags specifying how a stdio should be transmitted to the child process.
3939
pub struct StdioFlags: u32 {
40+
/// No file descriptor will be provided (or redirected to `/dev/null` if it is fd 0, 1 or
41+
/// 2).
4042
const IGNORE = uv::uv_stdio_flags_UV_IGNORE as _;
43+
44+
/// Open a new pipe into `data.stream`, per the flags below. The `data.stream` field must
45+
/// point to a PipeHandle object that has been initialized with `new`, but not yet opened
46+
/// or connected.
4147
const CREATE_PIPE = uv::uv_stdio_flags_UV_CREATE_PIPE as _;
48+
49+
/// The child process will be given a duplicate of the parent's file descriptor given by
50+
/// `data.fd`.
4251
const INHERIT_FD = uv::uv_stdio_flags_UV_INHERIT_FD as _;
52+
53+
/// The child process will be given a duplicate of the parent's file descriptor being used
54+
/// by the stream handle given by `data.stream`.
4355
const INHERIT_STREAM = uv::uv_stdio_flags_UV_INHERIT_STREAM as _;
4456

4557
/// When UV_CREATE_PIPE is specified, UV_READABLE_PIPE and UV_WRITABLE_PIPE determine the

src/misc/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ pub fn resident_set_memory() -> crate::Result<usize> {
227227
crate::uvret(unsafe { uv_resident_set_memory(&mut rss as _) }).map(|_| rss as _)
228228
}
229229

230-
/// Gets the current system uptime.
230+
/// Gets the current system uptime. Depending on the system full or fractional seconds are
231+
/// returned.
231232
pub fn uptime() -> crate::Result<f64> {
232233
let mut uptime = 0f64;
233234
crate::uvret(unsafe { uv_uptime(&mut uptime as _) }).map(|_| uptime)

src/misc/os.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::{FromInner, IntoInner};
22
use std::ffi::CStr;
33
use uv::{
4-
uv_os_free_passwd, uv_os_get_passwd, uv_os_gethostname, uv_os_getpid, uv_os_getppid,
5-
uv_os_getpriority, uv_os_setpriority, uv_os_uname, uv_passwd_t, uv_utsname_t,
4+
uv_available_parallelism, uv_os_free_passwd, uv_os_get_passwd, uv_os_gethostname, uv_os_getpid,
5+
uv_os_getppid, uv_os_getpriority, uv_os_setpriority, uv_os_uname, uv_passwd_t, uv_utsname_t,
66
UV_MAXHOSTNAMESIZE,
77
};
88

@@ -122,6 +122,21 @@ pub fn getppid() -> Pid {
122122
unsafe { uv_os_getppid() as _ }
123123
}
124124

125+
/// Returns an estimate of the default amount of parallelism a program should use. Always returns a
126+
/// non-zero value.
127+
///
128+
/// On Linux, inspects the calling thread’s CPU affinity mask to determine if it has been pinned to
129+
/// specific CPUs.
130+
///
131+
/// On Windows, the available parallelism may be underreported on systems with more than 64 logical
132+
/// CPUs.
133+
///
134+
/// On other platforms, reports the number of CPUs that the operating system considers to be
135+
/// online.
136+
pub fn available_parallelism() -> u32 {
137+
unsafe { uv_available_parallelism() as _ }
138+
}
139+
125140
/// Retrieves the scheduling priority of the process specified by pid. The returned value of
126141
/// priority is between -20 (high priority) and 19 (low priority).
127142
///

0 commit comments

Comments
 (0)