src/vmm/hostfiles.bend checks
raw source on the hub · import 0xec4070cc970212faf4003d589ad8e6c1/src/vmm/hostfiles.bend as Hostfiles
2 imports
import Base import ../lib/u64.bend as U
Types
type Listen source · line 29 · raw
Data
LBindListen
LReplaceListen
LInUseListen
LNotSocketListen
Definitions
def Files.private source · line 23 · raw
U32
def Files.private_dir source · line 26 · raw
U32
def Files.listen.sock source · line 37 · raw
@live:Bool -> Listen
kind: 0 nothing, 1 a socket, 2 anything else (as lstat sees it, so a symlink is anything else); live: a process accepted a connection on it.
def Files.listen source · line 44 · raw
@+kind:U32 -> @live:Bool -> Listen
def Files.listen.why source · line 48 · raw
@l:Listen -> String
Why a listen was refused, for the error message; "" when it may go on.
def Files.listen.replace source · line 59 · raw
@l:Listen -> Bool
def Files.dir_trusted source · line 68 · raw
@+kind:U32 -> @mine:Bool -> @+perm:U32 -> Bool
kind: 0 nothing, 1 a directory, 2 anything else (lstat); mine: this user's; perm: its permission bits.
def Files.hex2 source · line 74 · raw
@+b:U32 -> String
A VM's socket in the LAN directory: its MAC, two lowercase hex digits a byte joined by "-", then ".sock" (host/hvf.c names the sockets it sends to the same way).
def Files.mac.go source · line 77 · raw
@bs:List<&2, U32> -> String
def Files.lan_sock source · line 86 · raw
@+mac:List<&2, U32> -> String
def Files.exec_path source · line 93 · raw
@+sys:String -> @+argv0:String -> String
The program a guest reset starts again (Hvf.reexec): this executable as the system names it (Hvf.exe_path; "" when it cannot), else the first argument as given, found from the working directory; "" when there is neither, and the reset fails.
def Files.utf8_len source · line 97 · raw
@s:String -> U32
A socket path's bytes (UTF-8, as the host passes it to bind).
def Files.sock_path_fits source · line 109 · raw
@+path:String -> @+max:U32 -> Bool
Whether a Unix socket can be bound at path: its bytes fit the address's path field, which holds max of them and the closing 0 (Hvf.sock_path_max: 103 on macOS, 107 on Linux). Checked before listening, so a long path is an error that says so.
def Files.sock_path_why source · line 112 · raw
@+path:String -> @+max:U32 -> String