microsandbox-filesystem 0.3.12

Filesystem backends and guest filesystem support for microsandbox.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Handle table for open file descriptors.

use std::{fs::File, sync::RwLock};

//--------------------------------------------------------------------------------------------------
// Types
//--------------------------------------------------------------------------------------------------

/// Data associated with an open file handle.
pub(crate) struct HandleData {
    /// The real host file descriptor.
    ///
    /// Wrapped in `RwLock` because `preadv64`/`pwritev64` only need a shared
    /// lock (they take an explicit offset), while `lseek`, `fsync`, and
    /// `ftruncate` need exclusive access.
    pub file: RwLock<File>,
}