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

Fixes #31229 - fixes up BSD type mismatch errors and updates libc dependency. DEAD, see PR #31263 #31230

Closed
wants to merge 3 commits into from

Conversation

dhuseby
Copy link

@dhuseby dhuseby commented Jan 27, 2016

fixes the type mismatches breaking the build.

@rust-highfive
Copy link
Collaborator

r? @brson

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

@dhuseby dhuseby added A-bsd O-openbsd Operating system: OpenBSD O-freebsd Operating system: FreeBSD O-netbsd Operating system: NetBSD labels Jan 27, 2016
@@ -224,7 +224,7 @@ impl DirEntry {
fn name_bytes(&self) -> &[u8] {
unsafe {
::slice::from_raw_parts(self.entry.d_name.as_ptr() as *const u8,
self.entry.d_namelen as usize)
self.entry.d_namlen as usize)
Copy link
Member

Choose a reason for hiding this comment

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

Can you unify this with the block above? after this change they're all the same

Copy link
Author

Choose a reason for hiding this comment

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

unified now. thanks, i missed that.

@semarie
Copy link
Contributor

semarie commented Jan 27, 2016

@dhuseby could you merge back openbsd definition of num_cpus() with others ?

There is a small difference in `HW_NCPU' meaning, but I think it shouldn't be a problem (under OpenBSD it is "number of cpus being used" whereas for NetBSD, FreeBSD and DragonFly it is "number of cups").

@dhuseby
Copy link
Author

dhuseby commented Jan 27, 2016

@semarie on OpenBSD, is the sysconf(_SC_NPROCESSORS_ONLN) the same as the sysctl(HW_NCPUS)? Technically, sysconf is the POSIX way to get the number of available CPUs whereas the sysctl function isn't. I'm not against switching back, but I would like to better understand why. I think switching to sysconf(_SC_NPROCESSORS_ONLN) is more accurate and more portable.

@semarie
Copy link
Contributor

semarie commented Jan 27, 2016

@dhuseby yes sysconf(_SC_NPROCESSORS_ONLN) is the same as sysctl(HW_NCPUS) under OpenBSD. Initially I make a different case, because of laking of HW_AVAILCPU under OpenBSD. I agree that sysconf is the better way to do it.

@alexcrichton
Copy link
Member

Could you also tweak the title of the PR and the commit message to expand a little more what's going on? Helps out those who skim the git logs!

@dhuseby dhuseby changed the title Fixes #31229 Fixes #31229 - fixes up BSD type mismatch errors and updates libc dependency Jan 27, 2016
@dhuseby dhuseby closed this Jan 28, 2016
@dhuseby
Copy link
Author

dhuseby commented Jan 28, 2016

wtf? i didn't mean to close it. the latest commit isn't being picked up. i'll start another pr.

@dhuseby dhuseby changed the title Fixes #31229 - fixes up BSD type mismatch errors and updates libc dependency Fixes #31229 - fixes up BSD type mismatch errors and updates libc dependency. DEAD, see PR #31263 Jan 28, 2016
bors added a commit that referenced this pull request Feb 3, 2016
Something went haywire with github last night and the old PR #31230 got closed somehow.  This new PR is to replace the old one.  This incorporates all of the feedback from the other PR.

@alexcrichton I incorporated the suggestion from @semarie and the result is cleaner and clearer.  I think this is ready to go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-freebsd Operating system: FreeBSD O-netbsd Operating system: NetBSD O-openbsd Operating system: OpenBSD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants