EgretDoc
Back to Home
Location:system/os

Module

Module documentation.

moduleos

Classes

Classes and inheritance.

Functions

Free functions and class methods.

functionos::spawn_shell
Signaturefunc spawn_shell(cmd: String) -> Int
func 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
Signaturefunc exec_capture_raw(cmd: String) -> String
func 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
Signaturefunc exec(cmd: String) -> Int, ErrCode
func 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
Signaturefunc exec_capture(cmd: String) -> String, ErrCode
func 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
Signaturefunc exit(code: Int) -> Void
func 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
Signaturefunc args(argc: Int, argv: Int) -> collections.Vector<String>, ErrCode
func 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
Signaturefunc argv_get(argc: Int, argv: Int, idx: Int) -> String, ErrCode
func 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
Signaturefunc pid() -> Int
func 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
Signaturefunc ppid() -> Int
func 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
Signaturefunc fork() -> Int, ErrCode
func 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
Signaturefunc clone(flags: Int = 0) -> Int, ErrCode
func 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
Signaturefunc wait_pid(pid: Int) -> Int, ErrCode
func 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
Signaturefunc pipe() -> os.process.Pipe, ErrCode
func 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
Signatureextern 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
Signaturefunc hostname() -> String, ErrCode
func 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
Signatureextern 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
Signatureextern 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
Signatureextern 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
Signatureextern 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
Signaturefunc getenv(key: String) -> String, ErrCode
func 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
Signaturefunc setenv(key: String, val: String) -> Int, ErrCode
func 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
Signaturefunc unsetenv(key: String) -> Int, ErrCode
func 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
Signaturefunc environ() -> collections.Vector<String>, ErrCode
func 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).