Module process

Source
Expand description

Module for process-related high-level functions over process related syscalls

Such as api initialization functions _c_api_init and sysapi_init, environment variables, and process arguments

Structs§

ArgsIter
An iterator over the arguments passed to the program.

Functions§

_c_api_init
Initializes the safa-api, converts arguments to C-style arguments, calls main, and exits with the result main are designed as C main function,
env_clear
env_get
env_get_all
Gets all the environment variables in the current process
env_remove
env_set
meta_take
sysapi_init
Initializes the safa-api
sysenv_clear
Clear all environment variables.
sysenv_get
Get an environment variable by key.
sysenv_remove
Remove an environment variable by key.
sysenv_set
Set an environment variable by key.
sysget_arg
Get the argument at the given index.
sysget_argc
Get the number of arguments passed to the program.
sysmeta_stderr
Returns the resource id of the stderr file descriptor
sysmeta_stdin
Returns the resource id of the stdin file descriptor
sysmeta_stdout
Returns the resource id of the stdout file descriptor
sysmeta_take
Takes ownership of the task metadata the task metadata is used to store the stdin, stdout, and stderr file descriptors this syscall can only be called once otherwise it will return ErrorStatus::Generic (1)