![]() |
Max OS 0.3
|
A wrapper for a Process which exposes Process operations as Resource operations. More...
#include <scheduler_resources.h>
Public Member Functions | |
| ProcessResource (const string &name, size_t flags, resource_type_t type) | |
| void | close (size_t flags) final |
| Closes the process resource, killing the process and removing it from the scheduler. | |
| int | read (void *buffer, size_t size, size_t flags) final |
| Reads data from the process resource. | |
| int | write (const void *buffer, size_t size, size_t flags) final |
| Writes data to the process resource. | |
Public Attributes | |
| Process * | process |
| The process that this resource handles & exposes. | |
| uint64_t | exit_code |
| The exit code of the process once it has exited. | |
A wrapper for a Process which exposes Process operations as Resource operations.
Definition at line 34 of file scheduler_resources.h.
| ProcessResource::ProcessResource | ( | const string & | name, |
| size_t | flags, | ||
| resource_type_t | type | ||
| ) |
Definition at line 20 of file scheduler_resources.cpp.
|
final |
Closes the process resource, killing the process and removing it from the scheduler.
| flags | N/A |
Definition at line 31 of file scheduler_resources.cpp.
References process, and MaxOS::processes::GlobalScheduler::remove_process().
|
final |
Reads data from the process resource.
| buffer | The buffer to read into |
| size | The number of bytes to read |
| flags | The flags to pass to the reading |
Definition at line 46 of file scheduler_resources.cpp.
References exit_code, MaxOS::memory::MemoryManager::malloc(), MaxOS::processes::Process::pid(), process, MaxOS::processes::Process::resource_manager, MaxOS::processes::resources::ResourceManager::resources(), MaxOS::processes::Process::threads(), MaxOS::processes::Process::total_ticks(), and MaxOS::processes::Process::working_directory.
|
final |
Writes data to the process resource.
| buffer | The buffer to write from |
| size | The number of bytes to write |
| flags | The flags to pass to the writing |
Definition at line 145 of file scheduler_resources.cpp.
References exit_code, process, MaxOS::processes::GlobalScheduler::remove_process(), MaxOS::processes::Process::threads(), and MaxOS::processes::Process::working_directory.
| uint64_t MaxOS::processes::resources::ProcessResource::exit_code |
The exit code of the process once it has exited.
Definition at line 41 of file scheduler_resources.h.
| Process* MaxOS::processes::resources::ProcessResource::process |
The process that this resource handles & exposes.
Definition at line 40 of file scheduler_resources.h.