EgretDoc
Back to Home
Location:system/os.process

Module

Module documentation.

moduleos.process

Classes

Classes and inheritance.

classos.process::Pipe
@brief`Pipe` type.
@details`Pipe` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Pipe {
    /*
    @brief `read_fd` field.

Functions

Free functions and class methods.

functionos.process::__argv_get
Signatureextern func __argv_get(argc: Int, argv: Int, idx: Int) -> String;
extern func __argv_get(argc: Int, argv: Int, idx: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__spawn_shell`.
@briefBinds the low-level runtime symbol `__argv_get`.
@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
  • argcNumber of command-line or native arguments available in `argv`.
  • argvNative pointer or vector containing command-line argument values.
  • idxZero-based index.
@returnReturns the operation result as `String`.
functionos.process::__spawn_shell
Signatureextern func __spawn_shell(cmd: String) -> Int;
extern func __spawn_shell(cmd: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__exec_capture`.
@briefBinds the low-level runtime symbol `__spawn_shell`.
@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
  • cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns the operation result as `Int`.
functionos.process::__exec_capture
Signatureextern func __exec_capture(cmd: String) -> String;
extern func __exec_capture(cmd: String) -> String;
/*
@brief Binds the low-level runtime symbol `__os_exit`.
@briefBinds the low-level runtime symbol `__exec_capture`.
@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
  • cmdCommand string or command code sent to a process, protocol, or runtime binding.
@returnReturns the operation result as `String`.
functionos.process::__os_exit
Signatureextern func __os_exit(code: Int) -> Void;
extern func __os_exit(code: Int) -> Void;
/*
@brief Binds the low-level runtime symbol `__process_getpid`.
@briefBinds the low-level runtime symbol `__os_exit`.
@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
  • codeNumeric status, error, signal, opcode, or platform code handled by this API.
@returnVoid
functionos.process::__process_getpid
Signatureextern func __process_getpid() -> Int;
extern func __process_getpid() -> Int;
/*
@brief Binds the low-level runtime symbol `__process_getppid`.
@briefBinds the low-level runtime symbol `__process_getpid`.
@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 `Int`.
functionos.process::__process_getppid
Signatureextern func __process_getppid() -> Int;
extern func __process_getppid() -> Int;
/*
@brief Binds the low-level runtime symbol `__process_fork`.
@briefBinds the low-level runtime symbol `__process_getppid`.
@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 `Int`.
functionos.process::__process_fork
Signatureextern func __process_fork() -> Int;
extern func __process_fork() -> Int;
/*
@brief Binds the low-level runtime symbol `__process_clone`.
@briefBinds the low-level runtime symbol `__process_fork`.
@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 `Int`.
functionos.process::__process_clone
Signatureextern func __process_clone(flags: Int) -> Int;
extern func __process_clone(flags: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__process_wait_pid`.
@briefBinds the low-level runtime symbol `__process_clone`.
@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
  • flagsBitmask of option flags that controls how the operation is performed.
@returnReturns the operation result as `Int`.
functionos.process::__process_wait_pid
Signatureextern func __process_wait_pid(pid: Int) -> Int;
extern func __process_wait_pid(pid: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__process_pipe`.
@briefBinds the low-level runtime symbol `__process_wait_pid`.
@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
  • pidOperating-system process identifier targeted by the operation.
@returnReturns the operation result as `Int`.
functionos.process::__process_pipe
Signatureextern func __process_pipe() -> Int;
extern func __process_pipe() -> Int;
/*
@brief Binds the low-level runtime symbol `__posix_fd_pair_left`.
@briefBinds the low-level runtime symbol `__process_pipe`.
@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 `Int`.
functionos.process::__posix_fd_pair_left
Signatureextern func __posix_fd_pair_left(handle: Int) -> Int;
extern func __posix_fd_pair_left(handle: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__posix_fd_pair_right`.
@briefBinds the low-level runtime symbol `__posix_fd_pair_left`.
@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
  • handleUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionos.process::__posix_fd_pair_right
Signatureextern func __posix_fd_pair_right(handle: Int) -> Int;
extern func __posix_fd_pair_right(handle: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__posix_fd_pair_free`.
@briefBinds the low-level runtime symbol `__posix_fd_pair_right`.
@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
  • handleUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionos.process::__posix_fd_pair_free
Signatureextern func __posix_fd_pair_free(handle: Int) -> Void;
extern func __posix_fd_pair_free(handle: Int) -> Void;
/*
@brief Binds the low-level runtime symbol `__posix_read_fd`.
@briefBinds the low-level runtime symbol `__posix_fd_pair_free`.
@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
  • handleUnderlying runtime handle.
@returnVoid
functionos.process::__posix_read_fd
Signatureextern func __posix_read_fd(fd: Int, max_bytes: Int) -> String;
extern func __posix_read_fd(fd: Int, max_bytes: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__posix_write_fd`.
@briefBinds the low-level runtime symbol `__posix_read_fd`.
@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
  • fdOperating-system file descriptor or socket descriptor.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns the operation result as `String`.
functionos.process::__posix_write_fd
Signatureextern func __posix_write_fd(fd: Int, data: String) -> Int;
extern func __posix_write_fd(fd: Int, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__posix_close_fd`.
@briefBinds the low-level runtime symbol `__posix_write_fd`.
@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
  • fdOperating-system file descriptor or socket descriptor.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionos.process::__posix_close_fd
Signatureextern func __posix_close_fd(fd: Int) -> Int;
extern func __posix_close_fd(fd: Int) -> Int;

/*
@briefBinds the low-level runtime symbol `__posix_close_fd`.
@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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns the operation result as `Int`.
functionos.process::Pipe.init
Signaturefunc init(self: os.process.Pipe, read_fd: Int = -1, write_fd: Int = -1) -> Void
    func init(self: os.process.Pipe, read_fd: Int = -1, write_fd: Int = -1) -> Void {
        self.read_fd = read_fd;
        self.write_fd = write_fd;
@briefInitializes a `Pipe` instance.
@detailsEstablishes the initial field state for `Pipe` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • read_fdFile descriptor used for reading data from a pipe, socket, or file.
  • write_fdFile descriptor used for writing data to a pipe, socket, or file.
@returnVoid
functionos.process::Pipe.close_read
Signaturefunc close_read(self: os.process.Pipe) -> ErrCode
    func close_read(self: os.process.Pipe) -> ErrCode {
        if self.closed_read {
            return std.OK;
@briefCloses resources with `Pipe.close_read`.
@detailsExecutes the `close_read` 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
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns `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.process::Pipe.close_write
Signaturefunc close_write(self: os.process.Pipe) -> ErrCode
    func close_write(self: os.process.Pipe) -> ErrCode {
        if self.closed_write {
            return std.OK;
@briefCloses resources with `Pipe.close_write`.
@detailsExecutes the `close_write` 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
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns `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.process::Pipe.close
Signaturefunc close(self: os.process.Pipe) -> ErrCode
    func close(self: os.process.Pipe) -> ErrCode {
        let read_err: ErrCode = self.close_read();
        let write_err: ErrCode = self.close_write();
@briefCloses resources and makes later operations unavailable with `Pipe.close`.
@detailsExecutes the `close` 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
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns `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.process::Pipe.read
Signaturefunc read(self: os.process.Pipe, max_bytes: Int) -> String, ErrCode
    func read(self: os.process.Pipe, max_bytes: Int) -> String, ErrCode {
        if self.closed_read || self.read_fd < 0 || max_bytes < 0 {
            return "", std.ERR_INVALID;
@briefReads data with `Pipe.read`.
@detailsExecutes the `read` 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
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • max_bytesMaximum number of bytes to read or process in this operation.
@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.process::Pipe.write
Signaturefunc write(self: os.process.Pipe, data: String) -> Int, ErrCode
    func write(self: os.process.Pipe, data: String) -> Int, ErrCode {
        if self.closed_write || self.write_fd < 0 {
            return 0, std.ERR_INVALID;
@briefWrites data with `Pipe.write`.
@detailsExecutes the `write` 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
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • dataInput or output data buffer.
@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.process::Pipe.dispose
Signaturefunc dispose(self: os.process.Pipe) -> Void
    func dispose(self: os.process.Pipe) -> Void {
        _ = self.close();
    }
@briefExplicitly releases resources owned by `Pipe`.
@detailsThis method deterministically cleans up file descriptors, network connections, native handles, buffers, or other external resources. Implementations should be idempotent where possible, and repeated calls must not corrupt object state.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionos.process::Pipe.deinit
Signaturefunc deinit(self: os.process.Pipe) -> Void
    func deinit(self: os.process.Pipe) -> Void {
        _ = self.close();
    }
@briefReleases fallback resources at the end of the `Pipe` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionos.process::spawn_shell
Signaturefunc spawn_shell(cmd: String) -> Int
func spawn_shell(cmd: String) -> Int {
    return __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.process::exec_capture_raw
Signaturefunc exec_capture_raw(cmd: String) -> String
func exec_capture_raw(cmd: String) -> String {
    return __exec_capture(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.process::exec
Signaturefunc exec(cmd: String) -> Int, ErrCode
func exec(cmd: String) -> Int, ErrCode {
    let rc: Int = __spawn_shell(cmd);
    if rc == 0 {
@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.process::exec_capture
Signaturefunc exec_capture(cmd: String) -> String, ErrCode
func exec_capture(cmd: String) -> String, ErrCode {
    return __exec_capture(cmd), std.OK;
}
@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.process::exit
Signaturefunc exit(code: Int) -> Void
func exit(code: Int) -> Void {
    _ = __os_exit(code);
    return;
@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.process::args
Signaturefunc args(argc: Int, argv: Int) -> collections.Vector<String>, ErrCode
func args(argc: Int, argv: Int) -> collections.Vector<String>, ErrCode {
    let out: collections.Vector<String> = new collections.Vector<String>();
    loop (let arg_index: Int = 0; arg_index < argc; arg_index += 1) {
@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.process::argv_get
Signaturefunc argv_get(argc: Int, argv: Int, idx: Int) -> String, ErrCode
func argv_get(argc: Int, argv: Int, idx: Int) -> String, ErrCode {
    if idx < 0 || idx >= argc {
        return "", std.ERR_INVALID;
@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.process::pid
Signaturefunc pid() -> Int
func pid() -> Int {
    return __process_getpid();
}
@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.process::ppid
Signaturefunc ppid() -> Int
func ppid() -> Int {
    return __process_getppid();
}
@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.process::fork
Signaturefunc fork() -> Int, ErrCode
func fork() -> Int, ErrCode {
    let pid: Int = __process_fork();
    if pid >= 0 {
@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.process::clone
Signaturefunc clone(flags: Int = 0) -> Int, ErrCode
func clone(flags: Int = 0) -> Int, ErrCode {
    let pid: Int = __process_clone(flags);
    if pid >= 0 {
@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.process::wait_pid
Signaturefunc wait_pid(pid: Int) -> Int, ErrCode
func wait_pid(pid: Int) -> Int, ErrCode {
    let status: Int = __process_wait_pid(pid);
    if status >= 0 {
@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.process::pipe
Signaturefunc pipe() -> os.process.Pipe, ErrCode
func pipe() -> os.process.Pipe, ErrCode {
    let pair: Int = __process_pipe();
    if pair == 0 {
@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.process::close_fd
Signaturefunc close_fd(fd: Int) -> ErrCode
func close_fd(fd: Int) -> ErrCode {
    if __posix_close_fd(fd) == 0 {
        return std.OK;
@briefCloses resources with `close_fd`.
@detailsExecutes the `close_fd` 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
  • fdOperating-system file descriptor or socket descriptor.
@returnReturns `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.process::read_fd
Signaturefunc read_fd(fd: Int, max_bytes: Int) -> String, ErrCode
func read_fd(fd: Int, max_bytes: Int) -> String, ErrCode {
    if fd < 0 || max_bytes < 0 {
        return "", std.ERR_INVALID;
@briefReads data with `read_fd`.
@detailsExecutes the `read_fd` 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
  • fdOperating-system file descriptor or socket descriptor.
  • max_bytesMaximum number of bytes to read or process in this operation.
@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.process::write_fd
Signaturefunc write_fd(fd: Int, data: String) -> Int, ErrCode
func write_fd(fd: Int, data: String) -> Int, ErrCode {
    let n: Int = __posix_write_fd(fd, data);
    if n < 0 {
@briefWrites data with `write_fd`.
@detailsExecutes the `write_fd` 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
  • fdOperating-system file descriptor or socket descriptor.
  • dataInput or output data buffer.
@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.

Variables

Class fields (var).

varos.process::Pipe.read_fd
TypeInt
@brief`read_fd` field.
@detailsHolds the `read_fd` value for each `Pipe` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
    var read_fd: Int;
    /*
    @brief `write_fd` field.
varos.process::Pipe.write_fd
TypeInt
@brief`write_fd` field.
@detailsHolds the `write_fd` value for each `Pipe` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
    var write_fd: Int;
    /*
    @brief `closed_read` field.
varos.process::Pipe.closed_read
TypeBool
@brief`closed_read` field.
@detailsHolds the `closed_read` value for each `Pipe` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
    var closed_read: Bool;
    /*
    @brief `closed_write` field.
varos.process::Pipe.closed_write
TypeBool
@brief`closed_write` field.
@detailsHolds the `closed_write` value for each `Pipe` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
    var closed_write: Bool;

    /*