func _io_host(request: IORequest) -> IntThe host adapter, in source: one arm per request case, each a fixed entry in the runtime's io operation table. Exhaustiveness keeps this dispatcher and the request enum in lockstep — adding a case forces an arm here.
View Source
pub func _io_host(request: IORequest) -> Int {
match request {
.read(fd, buf, count) -> #_ir(fd, buf, count) { %? = io 0 $0 $1 $2 },
.write(fd, buf, count) -> #_ir(fd, buf, count) { %? = io 1 $0 $1 $2 },
.open(path, flags, mode) -> #_ir(path, flags, mode) { %? = io 2 $0 $1 $2 },
.close(fd) -> #_ir(fd) { %? = io 3 $0 0 0 },
.sleep(ms) -> #_ir(ms) { %? = io 4 $0 0 0 },
.poll(fds, count, timeout) -> #_ir(fds, count, timeout) { %? = io 5 $0 $1 $2 },
.ctl(fd, op, arg) -> #_ir(fd, op, arg) { %? = io 6 $0 $1 $2 },
.socket(domain, socktype, proto) -> #_ir(domain, socktype, proto) { %? = io 7 $0 $1 $2 },
.bind(fd, addr, port) -> #_ir(fd, addr, port) { %? = io 8 $0 $1 $2 },
.listen(fd, backlog) -> #_ir(fd, backlog) { %? = io 9 $0 $1 0 },
.connect(fd, addr, port) -> #_ir(fd, addr, port) { %? = io 10 $0 $1 $2 },
.accept(fd) -> #_ir(fd) { %? = io 11 $0 0 0 },
.cwd_len -> #_ir { %? = io 12 0 0 0 },
.cwd_copy(buf) -> #_ir(buf) { %? = io 13 $0 0 0 },
.getenv_len(name, name_len) -> #_ir(name, name_len) { %? = io 14 $0 $1 0 },
.getenv_copy(name, name_len, buf) -> #_ir(name, name_len, buf) { %? = io 15 $0 $1 $2 },
.argc -> #_ir { %? = io 16 0 0 0 },
.arg_len(index) -> #_ir(index) { %? = io 17 $0 0 0 },
.arg_copy(index, buf) -> #_ir(index, buf) { %? = io 18 $0 $1 0 },
.dir_count(path) -> #_ir(path) { %? = io 19 $0 0 0 },
.dir_entry_kind(path, index) -> #_ir(path, index) { %? = io 20 $0 $1 0 },
.dir_entry_len(path, index) -> #_ir(path, index) { %? = io 21 $0 $1 0 },
.dir_entry_copy(path, index, buf) -> #_ir(path, index, buf) { %? = io 22 $0 $1 $2 },
.exit(code) -> #_ir(code) { %? = io 23 $0 0 0 },
.realpath_len(path) -> #_ir(path) { %? = io 24 $0 0 0 },
.realpath_copy(path, buf) -> #_ir(path, buf) { %? = io 25 $0 $1 0 },
.seek(fd, offset, whence) -> #_ir(fd, offset, whence) { %? = io 26 $0 $1 $2 },
.file_size(fd) -> #_ir(fd) { %? = io 27 $0 0 0 },
.monotonic_nanos -> #_ir { %? = io 28 0 0 0 }
}
}