Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/transport/fusedev/macos_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,19 @@ impl FuseSession {
}
}

/// Create a new fuse message writer and pass it to the given closure.
pub fn with_writer<F>(&mut self, f: F)
where
F: FnOnce(FuseDevWriter),
{
if let Some(file) = &self.file {
let fd = file.as_raw_fd();
let mut buf = vec![0x0u8; self.bufsize];
let writer = FuseDevWriter::new(fd, &mut buf).unwrap();
f(writer);
}
}

/// Wake channel loop
/// After macfuse unmount, read will throw ENODEV
/// So wakers is no need for macfuse to interrupt channel
Expand Down
Loading