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

Implement MacOS #4

Merged
merged 3 commits into from
Dec 16, 2021
Merged

Implement MacOS #4

merged 3 commits into from
Dec 16, 2021

Conversation

PhotonQuantum
Copy link
Contributor

Trying to make it work on macos so that the time crate can return local_offset.

However I'm not sure whether the proc_pidinfo call is thread-safe because it's an apple internal api. Looks like it copies task info struct to given buffer, so I assume the buffer is properly initialized.

@jhpratt jhpratt self-requested a review December 15, 2021 06:30
Copy link
Owner

@jhpratt jhpratt left a comment

Choose a reason for hiding this comment

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

I presume you have a Mac and have tested this? If so this is good to go with minor stylistic things.

Cargo.toml Outdated Show resolved Hide resolved
src/macos.rs Outdated Show resolved Hide resolved
src/macos.rs Outdated Show resolved Hide resolved
@PhotonQuantum
Copy link
Contributor Author

Yes, this code runs on my m1 based mbp.

@jhpratt
Copy link
Owner

jhpratt commented Dec 16, 2021

CI is failing. I believe it's because the extern crate libc; line isn't sufficiently gated. Otherwise this LGTM with the caveat that we should probably check malloc for failure.

@jhpratt jhpratt merged commit 1d4669c into jhpratt:main Dec 16, 2021
@jhpratt
Copy link
Owner

jhpratt commented Dec 16, 2021

Thanks again. Will release tonight.

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.

None yet

2 participants