Skip to content

Added the waitid interface #418

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

Closed
wants to merge 4 commits into from
Closed

Conversation

valarauca
Copy link
Contributor

Waitid allows for a non-blocking way to check the status of individual threads, groups of threads, or every thread on the system.

Not 100% sure about how the linking is handled. Also can't confirm that it exists for every platform currently. I'm more or less gonna use travis for that.

…n individual threads, thread groups, or every thread on the system.
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@valarauca
Copy link
Contributor Author

Invalid pointer type attempting fix.

P_ALL,
P_PID,
P_PGID
}
Copy link
Member

Choose a reason for hiding this comment

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

Right now we actually tend to avoid literal enum types as they're not extensible (while the C side is), so perhaps these could just be pub const P_ALL: c_int = i32?

Copy link
Contributor Author

@valarauca valarauca Oct 5, 2016

Choose a reason for hiding this comment

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

That should work. I wasn't sure which was more idiomatic. Should I go thought the whole song of dance of pub type id_t = c_int; pub const P_ALL: ::id_t = i32; ?

Oh nevermind id_t is defined.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah let's take the route of listing all the constants explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I lifted the the constant definition to linux/mod.rs from /linux/other/mod.rs because sys/wait.h should be standard cross all GNU/Linux platforms.

The type+explicitly declared constants is added. Waiting for Travis-ci to report.

…across all *GNU* platforms. So I think putting at this high of level is okay, but if that is true I should lift waitid up to apply to all the various linux flavors
pub enum fpos64_t {} // TODO: fill this out with a struct

pub const P_PID: ::id_t = 1;
pub const P_PGID: ::id_t = 2;
pub const P_ALL: ::id_t = 3;
Copy link
Member

Choose a reason for hiding this comment

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

Should these be idtype_t?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update.

Also while I have your attention. How does one go about adding the linux/*.h sources for linking?

I can see where to add them for the test suite/crate. This was the main issue why I couldn't merge the 2 remaining for PTRACE yesterday/last night.

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately those headers are a little difficult include, but if the uapi business works then I think it'd be relatively easy to add!

@alexcrichton
Copy link
Member

Looks like CI may still be failing?

@valarauca
Copy link
Contributor Author

Style error I'll submit a commit in the morning got distracted today

On Saturday, October 8, 2016, Alex Crichton [email protected]
wrote:

Looks like CI may still be failing?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#418 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ASViDGFMga0-O6jGUCfY5dOX2y6whKAsks5qx99vgaJpZM4KO8qQ
.

@valarauca
Copy link
Contributor Author

I'm not sure how to explain this failing.

On a lot of platforms the are running tests for idtype_t but this is type not a constant(?)

@alexcrichton
Copy link
Member

It looks like there's failures across various platforms, for examples mips-musl has idtype_t as unsigned and a different value for P_ALL

@valarauca valarauca closed this Oct 10, 2016
Susurrus pushed a commit to Susurrus/libc that referenced this pull request Mar 26, 2017
danielverkamp pushed a commit to danielverkamp/libc that referenced this pull request Apr 28, 2020
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.

3 participants