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
Update nix to 0.28.0 #2723
Comments
Hey can I take up this issue ? |
Yep, thanks! Assigned 👍 |
how to handle the change to the // 0.27.1
/// Write to a raw file descriptor.
///
/// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html)
pub fn write(fd: RawFd, buf: &[u8]) -> Result<usize> {
let res = unsafe {
libc::write(fd, buf.as_ptr() as *const c_void, buf.len() as size_t)
};
Errno::result(res).map(|r| r as usize)
} // 0.28.0
/// Write to a raw file descriptor.
///
/// See also [write(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html)
pub fn write<Fd: AsFd>(fd: Fd, buf: &[u8]) -> Result<usize> {
let res = unsafe {
libc::write(
fd.as_fd().as_raw_fd(),
buf.as_ptr().cast(),
buf.len() as size_t,
)
};
Errno::result(res).map(|r| r as usize)
} the trait bound |
the i32 can be converted to OwnedFd but the ownership is a bit confusing. unsafe { std::os::fd::OwnedFd::from_raw_fd( fd ) } |
i think a few types like because in a few places like let (read_end: OwnedFd, write_end: OwnedFd) =
pipe2(OFlag::O_CLOEXEC).map_err(LibcontainerError::OtherSyscall)?;
let mut builder_impl = ContainerBuilderImpl {
container_type: ContainerType::TenantContainer {
exec_notify_fd: write_end.as_raw_fd(),
},
...
|
ref : #2712
Nix update has some breaking changes , specifically in terms of deprecated fns , so need to update those to use non-deprecated things instead.
The text was updated successfully, but these errors were encountered: