[][src]Struct procfs::Lock

pub struct Lock {
    pub lock_type: LockType,
    pub mode: LockMode,
    pub kind: LockKind,
    pub pid: Option<i32>,
    pub devmaj: u32,
    pub devmin: u32,
    pub inode: u64,
    pub offset_first: usize,
    pub offset_last: Option<usize>,
}

Details about an individual file lock

See the locks function.

For an example, see the lslocks.rs example in the source repo.

Fields

lock_type: LockType

The type of lock

mode: LockMode

The lock mode (advisory or mandatory)

kind: LockKind

The kind of lock (read or write)

pid: Option<i32>

The process that owns the lock

Because OFD locks are not owned by a single process (since multiple processes may have file descriptors that refer to the same FD), this field may be None.

Before kernel 4.14 a bug meant that the PID of of the process that initially acquired the lock was displayed instead of None.

devmaj: u32

The major ID of the device containing the FS that contains this lock

devmin: u32

The minor ID of the device containing the FS that contains this lock

inode: u64

The inode of the locked file

offset_first: usize

The offset (in bytes) of the first byte of the lock.

For BSD locks, this value is always 0.

offset_last: Option<usize>

The offset (in bytes) of the last byte of the lock.

None means the lock extends to the end of the file. For BSD locks, the value is always None.

Trait Implementations

impl Debug for Lock[src]

Auto Trait Implementations

impl RefUnwindSafe for Lock

impl Send for Lock

impl Sync for Lock

impl Unpin for Lock

impl UnwindSafe for Lock

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.