4.2.6 copyinstr

string copyinstr(uintptr_t addr)
string copyinstr(uintptr_t addr, size_t maxlen)

The copyinstr function copies a null-terminated C string from the specified user address (addr) into a DTrace scratch buffer and returns the address of this buffer. The user address is interpreted as an address in the space of the process that is associated with the current thread. The maxlen parameter, if specified, sets a limit on the number of bytes past addr that are examined (the resulting string is always null-terminated). The resulting string's length is limited to the value set by the strsize option. See Chapter 10, Options and Tunables for details. As with the copyin function, the specified address must correspond to a faulted-in page in the current process. If the address does not correspond to a faulted-in page, or if insufficient scratch memory is available, NULL is returned and an error is generated.