PWRITE(3PROC) Process Control Library Functions PWRITE(3PROC)

Pwritewrite data to the address space of a process

Process Control Library (libproc, -lproc)

#include <libproc.h>

Pwrite(struct ps_prochandle *P, const void *buf, size_t nbyte, uintptr_t address);

The () function writes data from buf to the process handle P starting at the address address. It writes at most nbyte of data. The Pwrite() function is logically analogous to the pwrite(2) function.

For live processes, this function is equivalent to writing to the /proc file system file for the process. For core files, it writes to the logical address space of what was once the process and not the corresponding offset in the on-disk file. ELF objects grabbed through Pgrab_file(3PROC) do not support being written to.

The () function cannot be used to the size of a mapping; writing to an unmapped region generates an error.

Upon successful completion, the Pwrite() function returns the number of bytes successfully written to P. This number is never greater than nbyte. Otherwise, it returns and is set to indicate an error. For the full list of errors see the section in proc(5) and the section in pwrite(2).

In addition, the Pwrite() function will fail if:

P refers to an ELF object and not a core file or active process.

See in libproc(3LIB).

pwrite(2), libproc(3LIB), proc(5)

May 11, 2016 OmniOS