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

fcntl add F_GETPATH support for apple/netbsd/dragonfly #2142

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

devnexen
Copy link
Contributor

No description provided.

src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
test/test_fcntl.rs Outdated Show resolved Hide resolved
@SteveLauC
Copy link
Member

And, a changelog is needed

@devnexen devnexen force-pushed the fcntl_update_apple_netbsd branch 2 times, most recently from 9bde289 to 4c9219e Compare October 1, 2023 07:58
test/test_fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
@SteveLauC
Copy link
Member

Feel free to ping me when you think this is ready for the final review :)

@devnexen devnexen force-pushed the fcntl_update_apple_netbsd branch 5 times, most recently from 3c24274 to e4baa1a Compare October 1, 2023 09:08
src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
test/test_fcntl.rs Outdated Show resolved Hide resolved
@SteveLauC
Copy link
Member

PR LGTM now, BTW, a change log is needed

@devnexen
Copy link
Contributor Author

devnexen commented Oct 1, 2023

Yes I waited finishing the code first, still draft ;-)

@devnexen devnexen marked this pull request as ready for review October 1, 2023 10:06
test/test_fcntl.rs Outdated Show resolved Hide resolved
@SteveLauC SteveLauC self-assigned this Oct 1, 2023
@devnexen
Copy link
Contributor Author

devnexen commented Oct 1, 2023

PR LGTM now, BTW, a change log is needed

Nice to see asomers found a good help ;-)

@devnexen devnexen force-pushed the fcntl_update_apple_netbsd branch 2 times, most recently from c629896 to d800e1a Compare October 1, 2023 11:17
@SteveLauC SteveLauC changed the title fcntl add F_GETPATH support for apple/netbsd fcntl add F_GETPATH support for apple/netbsd/dragonfly Oct 1, 2023
src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
src/fcntl.rs Outdated Show resolved Hide resolved
test/test_fcntl.rs Outdated Show resolved Hide resolved
test/test_fcntl.rs Outdated Show resolved Hide resolved
test/test_fcntl.rs Outdated Show resolved Hide resolved
@asomers
Copy link
Member

asomers commented Oct 1, 2023

You'll have to raise MSRV to 1.69.0 do use CStr::from_byte_with_nul.

@SteveLauC
Copy link
Member

SteveLauC commented Oct 2, 2023

You'll have to raise MSRV to 1.69.0 do use CStr::from_byte_with_nul.

The MSRV will be bumped in #2144 so @devnexen you don't need to worry about it in this PR :)

@SteveLauC
Copy link
Member

You'll have to raise MSRV to 1.69.0 do use CStr::from_byte_with_nul.

The MSRV will be bumped in #2144 so @devnexen you don't need to worry about it in this PR :)

#2144 has been merged, @devnexen you can rebase now :)

@devnexen devnexen force-pushed the fcntl_update_apple_netbsd branch 2 times, most recently from 7f3d28e to 5fbf293 Compare October 3, 2023 06:47
CHANGELOG.md Outdated Show resolved Hide resolved
@devnexen devnexen force-pushed the fcntl_update_apple_netbsd branch 2 times, most recently from 17f9594 to 58ef073 Compare October 3, 2023 07:25
@SteveLauC
Copy link
Member

For the requested changes in test_fcntl.rs, would you like to resolve them? If so, I think this PR is good to be merged.

A test function similar to the following one would be good :)

#[cfg(any(
    target_os = "dragonfly",
    target_os = "netbsd",
    target_os = "macos",
    target_os = "ios"
))]
fn test_f_get_path() {
    use nix::fcntl::*;
    use std::{os::unix::io::AsRawFd, path::PathBuf};
    use tempfile::NamedTempFile;

    let tmp = NamedTempFile::new().unwrap();
    let fd = tmp.as_raw_fd();
    let mut path = PathBuf::new();
    let res =
        fcntl(fd, FcntlArg::F_GETPATH(&mut path)).expect("get path failed");
    assert_ne!(res, -1);
    assert_eq!(
        path.as_path().canonicalize().unwrap(),
        tmp.path().canonicalize().unwrap()
    );
}

@SteveLauC SteveLauC added this pull request to the merge queue Oct 3, 2023
Merged via the queue into nix-rust:master with commit 68c230b Oct 3, 2023
35 checks passed
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

3 participants