⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

TimerFdNode

Struct TimerFdNode 

Source
pub struct TimerFdNode { /* private fields */ }
Expand description

VfsNode wrapper around a timerfd instance.

This allows timerfd to be inserted into a process’s file table so that standard read()/close()/epoll work on it. musl’s timerfd_create() syscall expects a real file descriptor.

Implementations§

Source§

impl TimerFdNode

Source

pub fn new(tfd_id: u32) -> Self

Source

pub fn tfd_id(&self) -> u32

Get the internal timerfd ID (needed for timerfd_settime/gettime).

Trait Implementations§

Source§

impl Drop for TimerFdNode

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl VfsNode for TimerFdNode

Source§

fn node_type(&self) -> NodeType

Node type query (also serves as vtable slot padding for AArch64)
Source§

fn read(&self, _offset: usize, buffer: &mut [u8]) -> Result<usize, KernelError>

Read data from the node
Source§

fn write(&self, _offset: usize, _data: &[u8]) -> Result<usize, KernelError>

Write data to the node
Source§

fn poll_readiness(&self) -> u16

Poll readiness for I/O multiplexing (poll/epoll). Read more
Source§

fn metadata(&self) -> Result<Metadata, KernelError>

Get metadata for the node
Source§

fn readdir(&self) -> Result<Vec<DirEntry>, KernelError>

List directory entries (if this is a directory)
Source§

fn lookup(&self, _name: &str) -> Result<Arc<dyn VfsNode>, KernelError>

Look up a child node by name (if this is a directory)
Source§

fn create( &self, _name: &str, _permissions: Permissions, ) -> Result<Arc<dyn VfsNode>, KernelError>

Create a new file in this directory
Source§

fn mkdir( &self, _name: &str, _permissions: Permissions, ) -> Result<Arc<dyn VfsNode>, KernelError>

Create a new directory in this directory
Remove a file or empty directory
Source§

fn as_any(&self) -> Option<&dyn Any>

Downcast to &dyn core::any::Any for type-specific operations. Read more
Source§

fn truncate(&self, _size: usize) -> Result<(), KernelError>

Truncate the file to the specified size
Create a hard link to this node
Create a symbolic link in this directory. Read more
Read the target of a symbolic link. Read more
Source§

fn chmod(&self, _permissions: Permissions) -> Result<(), KernelError>

Change permissions on this node

Auto Trait Implementations§

§

impl Freeze for TimerFdNode

§

impl RefUnwindSafe for TimerFdNode

§

impl Send for TimerFdNode

§

impl Sync for TimerFdNode

§

impl Unpin for TimerFdNode

§

impl UnwindSafe for TimerFdNode

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.