Module
Module documentation.
moduleos
Classes
Classes and inheritance.
Functions
Free functions and class methods.
functionos::spawn_shell
Signature
func spawn_shell(cmd: String) -> Intfunc spawn_shell(cmd: String) -> Int {
return os.process.spawn_shell(cmd);
}@briefProvides the system library operation `spawn_shell`.
@detailsExecutes the `spawn_shell` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns the operation result as `Int`.
functionos::exec_capture_raw
Signature
func exec_capture_raw(cmd: String) -> Stringfunc exec_capture_raw(cmd: String) -> String {
return os.process.exec_capture_raw(cmd);
}@briefProvides the system library operation `exec_capture_raw`.
@detailsExecutes the `exec_capture_raw` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns the operation result as `String`.
functionos::exec
Signature
func exec(cmd: String) -> Int, ErrCodefunc exec(cmd: String) -> Int, ErrCode {
return os.process.exec(cmd);
}@briefProvides the system library operation `exec`.
@detailsExecutes the `exec` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::exec_capture
Signature
func exec_capture(cmd: String) -> String, ErrCodefunc exec_capture(cmd: String) -> String, ErrCode {
return os.process.exec_capture(cmd);
}@briefProvides the system library operation `exec_capture`.
@detailsExecutes the `exec_capture` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::exit
Signature
func exit(code: Int) -> Voidfunc exit(code: Int) -> Void {
_ = os.process.exit(code);
}@briefProvides the system library operation `exit`.
@detailsExecutes the `exit` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- codeNumeric status, error, signal, opcode, or platform code handled by this API.
@returnVoid
functionos::args
Signature
func args(argc: Int, argv: Int) -> collections.Vector<String>, ErrCodefunc args(argc: Int, argv: Int) -> collections.Vector<String>, ErrCode {
return os.process.args(argc, argv);
}@briefProvides the system library operation `args`.
@detailsExecutes the `args` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- argcNumber of command-line or native arguments available in `argv`.
- argvNative pointer or vector containing command-line argument values.
@returnReturns `collections.Vector<String>, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::argv_get
Signature
func argv_get(argc: Int, argv: Int, idx: Int) -> String, ErrCodefunc argv_get(argc: Int, argv: Int, idx: Int) -> String, ErrCode {
return os.process.argv_get(argc, argv, idx);
}@briefProvides the system library operation `argv_get`.
@detailsExecutes the `argv_get` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- argcNumber of command-line or native arguments available in `argv`.
- argvNative pointer or vector containing command-line argument values.
- idxZero-based index.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::pid
Signature
func pid() -> Intfunc pid() -> Int {
return os.process.pid();
}@briefProvides the system library operation `pid`.
@detailsExecutes the `pid` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionos::ppid
Signature
func ppid() -> Intfunc ppid() -> Int {
return os.process.ppid();
}@briefProvides the system library operation `ppid`.
@detailsExecutes the `ppid` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionos::fork
Signature
func fork() -> Int, ErrCodefunc fork() -> Int, ErrCode {
return os.process.fork();
}@briefProvides the system library operation `fork`.
@detailsExecutes the `fork` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::clone
Signature
func clone(flags: Int = 0) -> Int, ErrCodefunc clone(flags: Int = 0) -> Int, ErrCode {
return os.process.clone(flags);
}@briefProvides the system library operation `clone`.
@detailsExecutes the `clone` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- flagsBitmask of option flags that controls how the operation is performed.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::wait_pid
Signature
func wait_pid(pid: Int) -> Int, ErrCodefunc wait_pid(pid: Int) -> Int, ErrCode {
return os.process.wait_pid(pid);
}@briefProvides the system library operation `wait_pid`.
@detailsExecutes the `wait_pid` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- pidOperating-system process identifier targeted by the operation.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::pipe
Signature
func pipe() -> os.process.Pipe, ErrCodefunc pipe() -> os.process.Pipe, ErrCode {
return os.process.pipe();
}@briefProvides the system library operation `pipe`.
@detailsExecutes the `pipe` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `os.process.Pipe, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::__os_hostname
Signature
extern func __os_hostname() -> String;extern func __os_hostname() -> String;
/*@briefBinds the low-level runtime symbol `__os_hostname`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `String`.
functionos::hostname
Signature
func hostname() -> String, ErrCodefunc hostname() -> String, ErrCode {
let h: String = __os_hostname();
if std.len(h) == 0 {@briefProvides the system library operation `hostname`.
@detailsExecutes the `hostname` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::__os_getenv
Signature
extern func __os_getenv(key: String) -> String;extern func __os_getenv(key: String) -> String;
/*
@brief Binds the low-level runtime symbol `__os_setenv`.@briefBinds the low-level runtime symbol `__os_getenv`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- keyKey name.
@returnReturns the operation result as `String`.
functionos::__os_setenv
Signature
extern func __os_setenv(key: String, val: String) -> Int;extern func __os_setenv(key: String, val: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_unsetenv`.@briefBinds the low-level runtime symbol `__os_setenv`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- keyKey name.
- valValue supplied by the caller for storage, comparison, encoding, or transmission.
@returnReturns the operation result as `Int`.
functionos::__os_unsetenv
Signature
extern func __os_unsetenv(key: String) -> Int;extern func __os_unsetenv(key: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_environ`.@briefBinds the low-level runtime symbol `__os_unsetenv`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
- keyKey name.
@returnReturns the operation result as `Int`.
functionos::__os_environ
Signature
extern func __os_environ() -> String;extern func __os_environ() -> String;
/*@briefBinds the low-level runtime symbol `__os_environ`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `String`.
functionos::getenv
Signature
func getenv(key: String) -> String, ErrCodefunc getenv(key: String) -> String, ErrCode {
return __os_getenv(key), std.OK;
}@briefProvides the system library operation `getenv`.
@detailsExecutes the `getenv` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- keyKey name.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::setenv
Signature
func setenv(key: String, val: String) -> Int, ErrCodefunc setenv(key: String, val: String) -> Int, ErrCode {
if __os_setenv(key, val) == 1 {
return 0, std.OK;@briefProvides the system library operation `setenv`.
@detailsExecutes the `setenv` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- keyKey name.
- valValue supplied by the caller for storage, comparison, encoding, or transmission.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::unsetenv
Signature
func unsetenv(key: String) -> Int, ErrCodefunc unsetenv(key: String) -> Int, ErrCode {
if __os_unsetenv(key) == 1 {
return 0, std.OK;@briefProvides the system library operation `unsetenv`.
@detailsExecutes the `unsetenv` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
- keyKey name.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionos::environ
Signature
func environ() -> collections.Vector<String>, ErrCodefunc environ() -> collections.Vector<String>, ErrCode {
let s: String = __os_environ();
let out: collections.Vector<String> = new collections.Vector<String>();@briefProvides the system library operation `environ`.
@detailsExecutes the `environ` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `collections.Vector<String>, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
Variables
Class fields (var).