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

freebsd: include missing libc crate #204

Closed
wants to merge 0 commits into from

Conversation

amshafer
Copy link
Contributor

This causes compilation issues with the libc references in the devname_r definition in the devname function. With this compiling on freebsd succeeds.

Also make the non-linux versions of dev_path public, so other OS types can call it.

Here's the error:

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
   --> src/node/mod.rs:215:9
    |
215 |         libc::devname_r(
    |         ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
   --> src/node/mod.rs:217:13
    |
217 |             libc::S_IFCHR, // Must be S_IFCHR or S_IFBLK
    |             ^^^^ use of undeclared crate or module `libc`

error[E0433]: failed to resolve: use of undeclared crate or module `libc`
   --> src/node/mod.rs:229:31
    |
229 |     unsafe { dev_name.set_len(libc::strlen(buf)) };
    |                               ^^^^ use of undeclared crate or module `libc`

Fix is relatively simple although I'm not sure if you want me to limit the libc dependency in Cargo.toml to freebsd as well?

@Drakulix
Copy link
Member

@amshafer Sorry for accidentally closing this, lets continue here #205

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.

2 participants