Skip to content

pidwait: optimize & cross-platform #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

FurryR
Copy link

@FurryR FurryR commented Apr 24, 2025

Resolves #399 (partially).

Needs to be reviewed before merge as it contains untested code. However it seems that at least the implementation for Linux works fine.

@Krysztal112233 Krysztal112233 self-requested a review April 25, 2025 07:08
@Krysztal112233
Copy link
Collaborator

Thank you for your contribution, I will start reviewing soon :)

@cakebaker
Copy link
Contributor

Hm, at least on my machine (using Linux) your changes make the test test_non_matching_pattern fail as it runs into a timeout:

failures:

---- test_pidwait::test_non_matching_pattern stdout ----
bin: "/home/dho/projects/procps/target/debug/procps"
run: /home/dho/projects/procps/target/debug/procps pidwait THIS_PATTERN_DOES_NOT_MATCH
bin: "/home/dho/projects/procps/target/debug/procps"
run: /home/dho/projects/procps/target/debug/procps pidwait DOES_NOT_MATCH

thread 'test_pidwait::test_non_matching_pattern' panicked at /home/dho/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/uutests-0.0.30/src/lib/util.rs:1912:35:
called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "wait: Timeout of '30s' reached" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

rustix = { version = "1", default-features = false, features = ["event", "process", "std"] }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_Threading"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use workspace = true as this dependency is defined as a workspace dependency in the root Cargo.toml.

Suggested change
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_Threading"] }
windows-sys = { workspace = true, features = ["Win32_Foundation", "Win32_System_Threading"] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] waitpid via epoll()
3 participants