MOS Source Code
Loading...
Searching...
No Matches
IO Struct Referenceabstract

#include <io.hpp>

+ Inheritance diagram for IO:

Public Member Functions

 IO (IOFlags flags, io_type_t type)
 
virtual ~IO ()=0
 
IOref ()
 
IOunref ()
 
virtual mos::string name () const
 
virtual off_t seek (off_t, io_seek_whence_t) final
 
virtual off_t tell () final
 
virtual size_t read (void *buf, size_t count) final
 
virtual size_t pread (void *buf, size_t count, off_t offset) final
 
virtual size_t write (const void *buf, size_t count) final
 
virtual bool VerifyMMapPermissions (VMFlags flags, bool is_private) final
 
bool map (vmap_t *vmap, off_t offset)
 
bool unmap (vmap_t *vmap, bool *unmapped)
 

Static Public Member Functions

static bool IsValid (const IO *io)
 

Public Attributes

const IOFlags io_flags = IO_NONE
 
const io_type_t io_type = IO_NULL
 

Private Member Functions

virtual void on_closed ()=0
 
virtual size_t on_read (void *, size_t)
 
virtual size_t on_write (const void *, size_t)
 
virtual bool on_mmap (vmap_t *, off_t)
 
virtual bool on_munmap (vmap_t *, bool *)
 
virtual off_t on_seek (off_t, io_seek_whence_t)
 

Private Attributes

bool io_closed = false
 
atomic_t io_refcount = 0
 

Friends

mos::SyslogStreamWriter operator<< (mos::SyslogStreamWriter stream, const IO *io)
 

Detailed Description

Definition at line 37 of file io.hpp.

Constructor & Destructor Documentation

◆ IO()

◆ ~IO()

~IO ( )
pure virtual

Definition at line 39 of file io.cpp.

Member Function Documentation

◆ IsValid()

static bool IsValid ( const IO * io)
inlinestatic

Definition at line 45 of file io.hpp.

Referenced by process_detach_fd(), process_do_execveat(), process_do_fork(), process_exit(), vfs_fstatat(), and vsnprintf_do_pointer_kernel().

+ Here is the call graph for this function:

◆ ref()

IO * ref ( )
inline

Definition at line 56 of file io.hpp.

Referenced by elf_fill_process(), io_dup(), io_dup2(), map(), mm_clone_vmap_locked(), process_attach_ref_fd(), and vmap_split().

+ Here is the call graph for this function:

◆ unref()

IO * unref ( )
inline

Definition at line 68 of file io.hpp.

Referenced by elf_fill_process(), process_detach_fd(), process_exit(), and unmap().

+ Here is the call graph for this function:

◆ name()

mos::string name ( ) const
virtual

Reimplemented in BasicFile, and Console.

Definition at line 45 of file io.cpp.

Referenced by operator<<, vsnprintf_do_pointer_kernel(), and x86_dump_stack_at().

+ Here is the call graph for this function:

◆ seek()

off_t seek ( off_t offset,
io_seek_whence_t whence )
finalvirtual

Definition at line 117 of file io.cpp.

Referenced by io_seek(), pread(), and tell().

+ Here is the call graph for this function:

◆ tell()

off_t tell ( )
finalvirtual

Definition at line 136 of file io.cpp.

Referenced by io_tell(), and pread().

+ Here is the call graph for this function:

◆ read()

size_t read ( void * buf,
size_t count )
finalvirtual

Definition at line 50 of file io.cpp.

Referenced by io_read(), io_readv(), Console::on_read(), and pread().

+ Here is the call graph for this function:

◆ pread()

size_t pread ( void * buf,
size_t count,
off_t offset )
finalvirtual

Definition at line 69 of file io.cpp.

Referenced by elf_read_file(), and io_pread().

+ Here is the call graph for this function:

◆ write()

size_t write ( const void * buf,
size_t count )
finalvirtual

Definition at line 98 of file io.cpp.

Referenced by io_write().

+ Here is the call graph for this function:

◆ VerifyMMapPermissions()

bool VerifyMMapPermissions ( VMFlags flags,
bool is_private )
finalvirtual

Definition at line 142 of file io.cpp.

Referenced by map(), and vm_protect().

◆ map()

bool map ( vmap_t * vmap,
off_t offset )

Definition at line 172 of file io.cpp.

Referenced by mmap_file().

+ Here is the call graph for this function:

◆ unmap()

bool unmap ( vmap_t * vmap,
bool * unmapped )

Definition at line 191 of file io.cpp.

Referenced by vmap_destroy().

+ Here is the call graph for this function:

◆ on_closed()

virtual void on_closed ( )
privatepure virtual

Implemented in Console, Directory, File, IPC_ControlIO, IpcClientIO, IpcServerIO, NullIO, and PipeIOImpl.

Referenced by on_closed(), and unref().

+ Here is the call graph for this function:

◆ on_read()

size_t on_read ( void * ,
size_t  )
privatevirtual

Reimplemented in Console, Directory, File, IpcClientIO, IpcServerIO, NullIO, and PipeIOImpl.

Definition at line 222 of file io.cpp.

Referenced by on_closed(), and read().

◆ on_write()

size_t on_write ( const void * ,
size_t  )
privatevirtual

Reimplemented in Console, File, IpcClientIO, IpcServerIO, NullIO, and PipeIOImpl.

Definition at line 228 of file io.cpp.

Referenced by on_closed(), and write().

◆ on_mmap()

bool on_mmap ( vmap_t * ,
off_t  )
privatevirtual

Reimplemented in File.

Definition at line 234 of file io.cpp.

Referenced by map(), and on_closed().

◆ on_munmap()

bool on_munmap ( vmap_t * ,
bool *  )
privatevirtual

Reimplemented in File.

Definition at line 240 of file io.cpp.

Referenced by on_closed(), and unmap().

◆ on_seek()

off_t on_seek ( off_t ,
io_seek_whence_t  )
privatevirtual

Reimplemented in File.

Definition at line 245 of file io.cpp.

Referenced by on_closed(), and seek().

Friends And Related Symbol Documentation

◆ operator<<

mos::SyslogStreamWriter operator<< ( mos::SyslogStreamWriter stream,
const IO * io )
friend

Definition at line 50 of file io.hpp.

Member Data Documentation

◆ io_flags

◆ io_type

◆ io_closed

bool io_closed = false
private

Definition at line 108 of file io.hpp.

Referenced by IsValid(), operator<<, pread(), read(), ref(), seek(), unmap(), unref(), VerifyMMapPermissions(), write(), and ~IO().

◆ io_refcount

atomic_t io_refcount = 0
private

Definition at line 109 of file io.hpp.

Referenced by IsValid(), ref(), and unref().


The documentation for this struct was generated from the following files: