Capabilities / memory.write
memory.write
@1PACKS ONLYNEEDS A GRANTWriting, allocating and protecting memory in a named address space.
Writing, allocating and protecting memory in a named address space.
Packs only, like reading. These take an address, which is exactly what a mod-visible call may never carry.
3 callsSurface as of 2026-10-21
Never granted automatically
A pack-only capability is absent from the import list a mod links against, so a mod that imports one is refused at load as asking for something the surface does not offer it. A pack is read by the host rather than linked against surface.h, so there is no C declaration to show here.
Calls
writeWRITES
write(address: u64, contents: Blob) -> Result<>
allocateWRITES
allocate(length: u32) -> Result<u64>
protectWRITES
protect(address: u64, length: u32, flags: u32) -> Result<>
Errors
A call that returns Result crosses as a status: 0 is success, and the others are these errors, by their index in the capability.
WriteFaultUnsupported