状态
当前可运行:
| API | 返回值 | 说明 |
|---|---|---|
std.proc.spawn(command) | ProcStatus | 通过显式进程能力接口创建进程状态。 |
std.proc.exitCode(status) | i32 | 读取进程状态码。 |
元数据标签:
- effects: proc
- allocation behavior: no allocation
- target support: host
- error behavior:
spawn返回ProcStatus;exitCode不会失败 - ownership notes: 当前状态模型中无所有权转移
- example:
examples/std-platform.0
示例
pub fn main Void world World ! let status std.proc.spawn "zero-noop" if == (std.proc.exitCode status) 0 check world.out.write "proc ok\n"设计说明
std.proc 仅限宿主目标。不支持进程的跨平台目标必须在代码生成之前拒绝进程辅助函数。
它们不应编译占位进程实现。