|PREAD(3PROC)||Process Control Library Functions||PREAD(3PROC)|
Pread(struct ps_prochandle *P,
void *buf, size_t nbytes,
*P, char *buf, size_t
nbytes, uintptr_t address);
Pread() function reads data from the process handle P starting at address in the address space of the process and reads at most nbytes of data into buf and is logically analogous to the pread(2) function.
For live processes, this function is equivalent to reading from the /proc file system as file for the process. For core files and file handles, it reads and writes from the logical address space and not the corresponding offset of the file itself. For example, a core file contains a sparse representation of the address space of a crashed process and unmapped regions are not present in the file. However, address still refers to the virtual addresses that were present at run-time and not those in the core file.
Pread_string() function is similar to
Pread() function, except that it attempts to
interpret address as a null terminated character
string and will stop reading characters into buf if
either nbytes has been read or a null terminator is
encountered. The resulting data in buf will always be
null terminated, even if no null terminator was found in the first
nbytes of data.
Pread_string() functions return a non-negative integer indicating the number of bytes actually read. Otherwise, the functions return -1 and set errno to indicate the error.
|May 11, 2016||OmniOS|