Skip to content
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

Add CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID constants #3923

Closed
wants to merge 1 commit into from
Closed

Conversation

0323pin
Copy link
Contributor

@0323pin 0323pin commented Sep 14, 2024

cpu-time, /~https://github.com/tailhook/cpu-time fails to compile because it misses these constants.

error[E0432]: unresolved imports `libc::CLOCK_PROCESS_CPUTIME_ID`, `libc::CLOCK_THREAD_CPUTIME_ID`
 --> src/clock_gettime.rs:7:12
  |
7 | use libc::{CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID};
  |            ^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^
  |            |                         |
  |            |                         no `CLOCK_THREAD_CPUTIME_ID` in the root
  |            |                         help: a similar name exists in the module: `_SC_THREAD_CPUTIME`
  |            no `CLOCK_PROCESS_CPUTIME_ID` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `cpu-time` (lib) due to 1 previous error
*** Error code 101

With this PR included cpu-time builds successfully,

Building for cpu-time-1.0.0
     Locking 5 packages to latest compatible versions
   Compiling libc v0.2.158
   Compiling cpu-time v1.0.0 (/usr/pkgsrc/wip/cpu-time/work/cpu-time-1.0.0)
    Finished `release` profile [optimized] target(s) in 3.56s

Please consider adding these.

@rustbot
Copy link
Collaborator

rustbot commented Sep 14, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@devnexen
Copy link
Contributor

I think your PR deserves the label stable-nominated (which you can add yourself I believe).

@0323pin
Copy link
Contributor Author

0323pin commented Sep 14, 2024

@devnexen It doesn't look like I can do it but, I might be wrong.

I was hoping this would get merged soon, since I have another unrelated addition locally.

@devnexen
Copy link
Contributor

devnexen commented Sep 14, 2024

That s fine the merger might do it then. The goal is your changes being backported to the libc-0.2 branch so it lands for the next 0.2.* release.

@0323pin
Copy link
Contributor Author

0323pin commented Sep 14, 2024

That s fine the merger might do it then. The goal is your changes being backported to the libc-0.2 branch so it lands for the next 0.2.* release.

That would be great. This is also the case with the one I have in the pipeline. Another missing definition on NetBSD.

@devnexen
Copy link
Contributor

devnexen commented Sep 14, 2024

sorry I forgot about this ! but you need to type the rustbot command label stable-nominated to add the label like here.

@0323pin
Copy link
Contributor Author

0323pin commented Sep 14, 2024

@rustbot label stable-nominated

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Sep 14, 2024
@0323pin
Copy link
Contributor Author

0323pin commented Sep 14, 2024

sorry I forgot about this ! but you need to type the rustbot command label stable-nominated to add the label like here.

Ahh ... thanks! That worked :)

@0323pin 0323pin closed this Sep 15, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 25, 2024
This PR adds support for:
  CLOCK_PROCESS_CPUTIME_ID
  CLOCK_THREAD_CPUTIME_ID
  sysctlnametomib

It replaces the following closed PRs:
#3926
#3923

Sorry for the back and forward actions.
@tgross35 tgross35 removed the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Oct 15, 2024
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Oct 16, 2024
This PR adds support for:
  CLOCK_PROCESS_CPUTIME_ID
  CLOCK_THREAD_CPUTIME_ID
  sysctlnametomib

It replaces the following closed PRs:
rust-lang#3926
rust-lang#3923

Sorry for the back and forward actions.

(backport <rust-lang#3927>)
(cherry picked from commit 8ff67c1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants