Environment variables could be injected into the main "service": CommandMain "my_app" inject Environment env entry main code String h = env.get "HOME" end It would be nice to get all 3 of: 1. Efficient initialization 2. Efficient access 3. Thread-safety Only 3 is a strict requirement. Solutions: * Copy the whole environment block at startup. * At the first non-SLUL call, copy all env strings, and update the environment block. - But how to detect "non-SLUL calls"? - Maybe there could be some function qualifier? But it could be really hard to track. * Redirect the "C-accessible" environment block to a separate page, which is handled by userfaultfd(?) and filled in as needed. * Map separate copy-on-write pages of the environment block at startup, such that the SLUL "Environment" object does not see the changes (the "copy" could even be mapped without write permission). On glibc/Linux there's ptrctl() PR_SET_MM_ENV_START/END. Related: Environment block access would probably require an initialized C library anyway. So SLUL has to somehow be able to tell when the C library needs to be initialized (or always initialize it). Initializing lazilly in a multi-threaded program could be tricky.