Ashet OS

namespace: ashet.resources

Documentation

All syscalls related to generic resource management.

System Calls

syscall get_type(in resource: SystemResource, out type: SystemResource.Type)

Returns the type of the system resource.

syscall get_owners(in resource: SystemResource, in owners: ?[]Process, out count: usize)

Returns the current owner of this resource.

syscall send_to_process(in resource: SystemResource, in target: Process)

Adds the process to the owners of this resource, so the process can safely access it without fear of having a use-after-free.

syscall release(in resource: SystemResource)

Drops the ownership of the resource for the current process. If no owner remains, the resource will be destroyed and its memory will be released. The handle must be assumed invalid for this process after this function returns.

syscall destroy(in resource: SystemResource)

Immediately destroys the resource and releases its memory.

Note:

This will *always* destroy the resource, even if it's also owned by another process.