Skip to content

DragonFly has different stat, dirent, clock_t, ino_t, nlink_t, blksize_t #117

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 3 commits into from
Closed

DragonFly has different stat, dirent, clock_t, ino_t, nlink_t, blksize_t #117

wants to merge 3 commits into from

Conversation

mneumann
Copy link
Contributor

Move FreeBSD's stat into freebsd_{x86,x86_64}.rs.

Move FreeBSD's stat into freebsd_{x86,x86_64}.rs.
@mneumann
Copy link
Contributor Author

Maybe, we should really split dragonfly and freebsd completely?

I had to duplicate utsname as DragonFly uses 32 bytes instead of 256.
@alexcrichton
Copy link
Member

Thanks! I don't mind if freebsd/dragonfly are completely separated, they just seemed to have a lot of definitions in common from the original liblibc.

Could you change the organization here to freebsd/{mod.rs,x86.rs,x86_64.rs} as well? Other than that looks good to me!

@mneumann
Copy link
Contributor Author

@alexcrichton : Ok, will split it from FreeBSD and will come up with another pull request

There is no shared x86 and x86_64 code between the two anymore. Instead these 4
lines of code were duplicated. We now only share architecture-independet
code between FreeBSD and DragonFly.
@mneumann
Copy link
Contributor Author

@alexcrichton : Ok there we go. There is currently no other architecture than x86_64 for DragonFly, that's why I kept all code in x86_64.rs, but still use the cfg_if in mod.rs to be on the safe side when new architecture arrive.

@@ -221,6 +229,9 @@ fn main() {
// sighandler_t is crazy across platforms
"sighandler_t" => true,

// does not exists on DragonFly
"fflags_t" if dragonfly => true,
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this could just be removed from the dragonfly definitions? It should be fine to push the typedef down lower into each respective module.

@alexcrichton
Copy link
Member

Looks good to me, thanks @mneumann!

@mneumann
Copy link
Contributor Author

As this pull-request became stale, I opened up a new one (#194) which fixes all current issues. Closing this one.

@mneumann mneumann closed this Feb 20, 2016
Susurrus pushed a commit to Susurrus/libc that referenced this pull request Mar 26, 2017
As described in rust-lang#117, the `AsExtStr` trait is defined to return a raw `*const
libc::c_char`. Its impl for `OsStr` simply borrowed the byte slice from its
`OsStr` argument and cast it to a `*const libc::c_char`, which does not
construct a proper null-terminated C string.

Given this, the `AsExtStr` is not necessary and is removed. `NixPath` is
updated to yield `CStr`.

Fixes rust-lang#117, rust-lang#120
Thanks to @dead10ck
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