Struct nc::types::statx_t

source ·
#[repr(C)]
pub struct statx_t {
Show 19 fields pub stx_mask: u32, pub stx_blksize: u32, pub stx_attributes: u64, pub stx_nlink: u32, pub stx_uid: u32, pub stx_gid: u32, pub stx_mode: u16, pub stx_ino: u64, pub stx_size: u64, pub stx_blocks: u64, pub stx_attributes_mask: u64, pub stx_atime: statx_timestamp_t, pub stx_btime: statx_timestamp_t, pub stx_ctime: statx_timestamp_t, pub stx_mtime: statx_timestamp_t, pub stx_rdev_major: u32, pub stx_rdev_minor: u32, pub stx_dev_major: u32, pub stx_dev_minor: u32, /* private fields */
}
Expand description

Structures for the extended file attribute retrieval system call (statx()).

The caller passes a mask of what they’re specifically interested in as a parameter to statx(). What statx() actually got will be indicated in st_mask upon return.

For each bit in the mask argument:

  • if the datum is not supported:

  • the bit will be cleared, and

  • the datum will be set to an appropriate fabricated value if one is available (eg. CIFS can take a default uid and gid), otherwise

  • the field will be cleared;

  • otherwise, if explicitly requested:

  • the datum will be synchronised to the server if AT_STATX_FORCE_SYNC is set or if the datum is considered out of date, and

  • the field will be filled in and the bit will be set;

  • otherwise, if not requested, but available in approximate form without any effort, it will be filled in anyway, and the bit will be set upon return (it might not be up to date, however, and no attempt will be made to synchronise the internal state first);

  • otherwise the field and the bit will be cleared before returning.

Items in STATX_BASIC_STATS may be marked unavailable on return, but they will have values installed for compatibility purposes so that stat() and co. can be emulated in userspace.

Fields§

§stx_mask: u32

What results were written (uncond)

§stx_blksize: u32

Preferred general I/O size (uncond)

§stx_attributes: u64

Flags conveying information about the file (uncond)

§stx_nlink: u32

Number of hard links

§stx_uid: u32

User ID of owner

§stx_gid: u32

Group ID of owner

§stx_mode: u16

File mode

§stx_ino: u64

Inode number

§stx_size: u64

File size

§stx_blocks: u64

Number of 512-byte blocks allocated

§stx_attributes_mask: u64

Mask to show what’s supported in stx_attributes

§stx_atime: statx_timestamp_t

Last access time

§stx_btime: statx_timestamp_t

File creation time

§stx_ctime: statx_timestamp_t

Last attribute change time

§stx_mtime: statx_timestamp_t

Last data modification time

§stx_rdev_major: u32

Device ID of special file (if bdev/cdev)

§stx_rdev_minor: u32§stx_dev_major: u32

ID of device containing file (uncond)

§stx_dev_minor: u32

Trait Implementations§

source§

impl Clone for statx_t

source§

fn clone(&self) -> statx_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for statx_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for statx_t

source§

fn default() -> statx_t

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.